Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/alexisvisco/amigo
/ functions
Functions
123 in github.com/alexisvisco/amigo
⨍
Functions
123
◇
Types & classes
28
↓ 17 callers
Method
ExecContext
ExecContext intercepts exec calls within a transaction
pkg/logsql/driver.go:374
↓ 13 callers
Method
error
error formats an error message in red
cli_output.go:37
↓ 10 callers
Method
Name
()
types.go:52
↓ 9 callers
Method
Date
()
types.go:38
↓ 7 callers
Function
contains
(s, substr string)
pkg/logsql/driver.go:123
↓ 6 callers
Method
Err
Err returns the first error that occurred during the chain, or nil if no errors occurred
utils.go:73
↓ 5 callers
Method
Run
Run executes the CLI with the given arguments This is the main entry point that should be called from your main function
cli.go:88
↓ 4 callers
Method
GetMigrationsStatuses
(ctx context.Context, migrations []Migration)
runner_get_migrations_statuses.go:9
↓ 4 callers
Method
QueryContext
QueryContext intercepts query calls within a transaction
pkg/logsql/driver.go:415
↓ 4 callers
Function
SQLFileToMigration
SQLFileToMigration converts a sql file from an embedded filesystem to a Migration struct
sql_migration.go:88
↓ 4 callers
Function
Tx
(ctx context.Context, db *sql.DB, f func(*sql.Tx) error)
utils.go:9
↓ 4 callers
Function
formatArgs
formatArgs formats arguments for display
pkg/logsql/driver.go:473
↓ 4 callers
Method
logQuery
(operation string, args interface{}, duration time.Duration, err error)
pkg/logsql/driver.go:249
↓ 4 callers
Function
namedValuesToValues
Helper functions to convert between driver value types
pkg/logsql/driver.go:456
↓ 3 callers
Method
CreateSchemaMigrationsTableIfNotExists
(ctx context.Context, db *sql.DB)
types.go:48
↓ 3 callers
Method
GetAppliedMigrations
(ctx context.Context, db *sql.DB)
types.go:49
↓ 3 callers
Method
Open
(name string)
pkg/logsql/driver.go:134
↓ 3 callers
Method
PrepareContext
PrepareContext creates a prepared statement within the transaction
pkg/logsql/driver.go:362
↓ 3 callers
Method
cliPrintHelp
cliPrintHelp displays the help message
cli.go:118
↓ 3 callers
Method
date
date formats a date/timestamp integer (YYYYMMDDHHMMSS) in green
cli_output.go:52
↓ 3 callers
Method
path
path formats a file path in cyan
cli_output.go:26
↓ 3 callers
Function
splitSQLStatementsWithAnnotations
splitSQLStatementsWithAnnotations splits a SQL string into individual statements, respecting -- amigo:statement:begin/end annotations that protect com
sql_migration.go:222
↓ 2 callers
Method
DownIterator
DownIterator returns an iterator that yields migration results as they are reverted
runner_down_iterator.go:11
↓ 2 callers
Method
Exec
Exec executes a SQL statement. If a previous error occurred, this is a no-op.
utils.go:64
↓ 2 callers
Function
NewCLI
NewCLI creates a new CLI instance with the given configuration
cli.go:53
↓ 2 callers
Function
NewChainExecTx
NewChainExecTx creates a new ChainExecTx for the given context and transaction
utils.go:97
↓ 2 callers
Method
Prepare
Prepare creates a prepared statement within the transaction
pkg/logsql/driver.go:351
↓ 2 callers
Method
Rollback
()
pkg/logsql/driver.go:341
↓ 2 callers
Method
UpIterator
UpIterator returns an iterator that yields migration results as they are applied
runner_up_iterator.go:18
↓ 2 callers
Function
WrapDriver
WrapDriver wraps a SQL driver to log all queries Returns the wrapped driver name to use with sql.Open()
pkg/logsql/driver.go:72
↓ 2 callers
Function
WrapOptionOutput
WrapOptionOutput sets the output writer for SQL logs
pkg/logsql/driver.go:50
↓ 2 callers
Method
cliGenerateHelp
cliGenerateHelp displays help for the generate command
cli_cmd_generate.go:157
↓ 2 callers
Method
duration
duration formats a duration in yellow (in milliseconds)
cli_output.go:31
↓ 2 callers
Method
execSQL
execSQL executes SQL within a transaction, either as a single exec or split by statements
sql_migration.go:48
↓ 2 callers
Method
execSQLDB
execSQLDB executes SQL on a DB, either as a single exec or split by statements
sql_migration.go:64
↓ 2 callers
Method
logQuery
(txPrefix, operation, query string, args interface{}, duration time.Duration, err error)
pkg/logsql/driver.go:173
↓ 2 callers
Method
logQuery
(operation, query string, duration time.Duration, err error)
pkg/logsql/driver.go:319
↓ 2 callers
Function
namedValuesToDriverValues
(args []driver.NamedValue)
pkg/logsql/driver.go:464
↓ 2 callers
Function
parseFileName
parseFileName parses the migration file name to extract the name and date ex: "20240101120000_create_users_table.sql" -> gives "20240101120000", "cr
sql_migration.go:112
↓ 2 callers
Function
parseSQLFile
parseSQLFile parses the content of a SQL file into an SQLMigration struct It looks for the up and down annotations to split the file into up and down
sql_migration.go:159
↓ 2 callers
Function
parseTxAnnotation
parseTxAnnotation parses the tx annotation from the given text and sets the value of b accordingly A typical refexp is regexp.MustCompile(`tx=(true|fa
sql_migration.go:203
↓ 2 callers
Function
sanitizeName
sanitizeName converts a migration name to a valid Go identifier
cli_cmd_generate.go:145
↓ 2 callers
Method
timestamp
timestamp formats a timestamp in green
cli_output.go:42
↓ 1 callers
Method
Begin
()
pkg/logsql/driver.go:212
↓ 1 callers
Method
BeginTx
(ctx context.Context, opts driver.TxOptions)
pkg/logsql/driver.go:225
↓ 1 callers
Method
Commit
()
pkg/logsql/driver.go:332
↓ 1 callers
Method
DeleteMigrations
(ctx context.Context, db *sql.DB, dates []int64)
types.go:51
↓ 1 callers
Method
Down
(ctx context.Context, db *sql.DB)
types.go:36
↓ 1 callers
Method
Exec
(args []driver.Value)
pkg/logsql/driver.go:274
↓ 1 callers
Method
InsertMigrations
(ctx context.Context, db *sql.DB, list []MigrationRecord)
types.go:50
↓ 1 callers
Function
NewPostgresDriver
(tableName string)
driver_pg.go:14
↓ 1 callers
Function
NewRunner
(config Configuration)
runner.go:13
↓ 1 callers
Function
NewSQLiteDriver
(tableName string)
driver_sqlite.go:14
↓ 1 callers
Method
Prepare
(query string)
pkg/logsql/driver.go:193
↓ 1 callers
Method
Query
(args []driver.Value)
pkg/logsql/driver.go:282
↓ 1 callers
Function
RunnerDownOptionSteps
(steps int)
runner_down.go:13
↓ 1 callers
Function
RunnerUpOptionSteps
(steps int)
runner_up.go:13
↓ 1 callers
Method
Up
(ctx context.Context, db *sql.DB)
types.go:35
↓ 1 callers
Method
cliDown
cliDown reverts applied migrations
cli_cmd_down.go:15
↓ 1 callers
Method
cliDownHelp
cliDownHelp displays help for the down command
cli_cmd_down.go:126
↓ 1 callers
Method
cliGenerate
cliGenerate creates a new migration file
cli_cmd_generate.go:15
↓ 1 callers
Method
cliShowConfig
cliShowConfig displays the current configuration
cli_cmd_show_config.go:10
↓ 1 callers
Method
cliShowConfigHelp
cliShowConfigHelp displays help for the show-config command
cli_cmd_show_config.go:46
↓ 1 callers
Method
cliStatus
cliStatus displays the status of all migrations
cli_cmd_status.go:11
↓ 1 callers
Method
cliStatusHelp
cliStatusHelp displays help for the status command
cli_cmd_status.go:80
↓ 1 callers
Method
cliUp
cliUp runs pending migrations
cli_cmd_up.go:14
↓ 1 callers
Method
cliUpHelp
cliUpHelp displays help for the up command
cli_cmd_up.go:116
↓ 1 callers
Function
defaultRunnerDownOpts
()
runner_down.go:19
↓ 1 callers
Function
defaultRunnerUpOpts
()
runner_up.go:19
↓ 1 callers
Function
defaultWrapOpts
()
pkg/logsql/driver.go:63
↓ 1 callers
Function
detectPlaceholderStyle
detectPlaceholderStyle auto-detects the placeholder style based on driver name
pkg/logsql/driver.go:110
↓ 1 callers
Method
filterNonAppliedMigrations
(migrations []Migration, appliedMigrations []MigrationRecord)
runner.go:17
↓ 1 callers
Method
generateGoTemplate
generateGoTemplate returns the Go migration template
cli_cmd_generate.go:122
↓ 1 callers
Method
generateMigrationsList
generateMigrationsList creates the migrations.go file with all migrations
cli_cmd_generate_migrations_list.go:33
↓ 1 callers
Method
generateSQLTemplate
generateSQLTemplate returns the SQL migration template
cli_cmd_generate.go:101
↓ 1 callers
Function
getDriver
getDriver retrieves a registered driver by name
pkg/logsql/driver.go:155
↓ 1 callers
Function
newCLIOutput
newCLIOutput creates a new cliOutput helper
cli_output.go:21
↓ 1 callers
Function
parseVersionToDate
(version any)
sql_migration.go:136
↓ 1 callers
Method
sortNewestFirstMigrationRecord
(appliedMigrations []MigrationRecord)
runner.go:43
↓ 1 callers
Function
splitLineByStatements
splitLineByStatements splits a line by semicolons, respecting quotes, and accumulates partial statements across lines.
sql_migration.go:271
Method
CreateSchemaMigrationsTableIfNotExists
(ctx context.Context, db *sql.DB)
driver_clickhouse.go:25
Method
CreateSchemaMigrationsTableIfNotExists
(ctx context.Context, db *sql.DB)
driver_sqlite.go:21
Method
CreateSchemaMigrationsTableIfNotExists
(ctx context.Context, db *sql.DB)
driver_pg.go:21
Method
Date
()
sql_migration.go:83
Method
Date
()
example/migrations/20251225101501_add_user_index.go:16
Method
DeleteMigrations
(ctx context.Context, db *sql.DB, dates []int64)
driver_clickhouse.go:98
Method
DeleteMigrations
(ctx context.Context, db *sql.DB, dates []int64)
driver_sqlite.go:72
Method
DeleteMigrations
(ctx context.Context, db *sql.DB, dates []int64)
driver_pg.go:72
Method
Down
(ctx context.Context, migrations []Migration, opts ...RunnerDownOptsFunc)
runner_down.go:25
Method
Down
(ctx context.Context, db *sql.DB)
sql_migration.go:37
Method
Down
(ctx context.Context, db *sql.DB)
example/migrations/20251225101501_add_user_index.go:28
Method
Err
Err returns the first error that occurred during the chain, or nil if no errors occurred
utils.go:114
Method
Exec
Exec executes a SQL statement within the transaction. If a previous error occurred, this is a no-op.
utils.go:105
Method
ExecContext
(ctx context.Context, args []driver.NamedValue)
pkg/logsql/driver.go:290
Method
GetAppliedMigrations
(ctx context.Context, db *sql.DB)
driver_clickhouse.go:54
Method
GetAppliedMigrations
(ctx context.Context, db *sql.DB)
driver_sqlite.go:34
Method
GetAppliedMigrations
(ctx context.Context, db *sql.DB)
driver_pg.go:34
Method
HasPendingMigrations
HasPendingMigrations checks if there are any pending migrations to apply
runner_get_migrations_statuses.go:57
Method
InsertMigrations
(ctx context.Context, db *sql.DB, list []MigrationRecord)
driver_clickhouse.go:81
Method
InsertMigrations
(ctx context.Context, db *sql.DB, list []MigrationRecord)
driver_sqlite.go:55
next →
1–100 of 123, ranked by callers