Skip to content

Instantly share code, notes, and snippets.

@ninedraft
Created January 19, 2026 11:35
Show Gist options
  • Select an option

  • Save ninedraft/41910b42bf00af06985024daa785ae5d to your computer and use it in GitHub Desktop.

Select an option

Save ninedraft/41910b42bf00af06985024daa785ae5d to your computer and use it in GitHub Desktop.
package dbacces
import (
"context"
"database/sql"
_ "embed"
)
//go:embed migrations/init.sql
var initsql string
func Init(ctx context.Context, db *sql.DB) error {
_, err := db.ExecContext(ctx, initsql)
return err
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment