OpenSQLiteDatabase opens a SQLite database, applies shared configuration, and retries once after moving aside a corrupt file.
( ctx context.Context, path string, initialize func(context.Context, *sql.DB) error, )
| 26 | // OpenSQLiteDatabase opens a SQLite database, applies shared configuration, |
| 27 | // and retries once after moving aside a corrupt file. |
| 28 | func OpenSQLiteDatabase( |
| 29 | ctx context.Context, |
| 30 | path string, |
| 31 | initialize func(context.Context, *sql.DB) error, |
| 32 | ) (*sql.DB, error) { |
| 33 | return openSQLiteDatabaseWithPragmas(ctx, path, nil, initialize) |
| 34 | } |
| 35 | |
| 36 | // OpenSQLiteDatabaseWithPragmas opens a SQLite database with additional driver-level pragmas. |
| 37 | func OpenSQLiteDatabaseWithPragmas( |