isInMemorySQLite checks if a SQLite URI refers to an in-memory database
(uri string)
| 393 | |
| 394 | // isInMemorySQLite checks if a SQLite URI refers to an in-memory database |
| 395 | func isInMemorySQLite(uri string) bool { |
| 396 | if uri == ":memory:" || uri == "" { |
| 397 | return true |
| 398 | } |
| 399 | // Check for file URI with mode=memory parameter |
| 400 | // e.g., "file:test?mode=memory&cache=shared" |
| 401 | if strings.Contains(uri, "mode=memory") { |
| 402 | return true |
| 403 | } |
| 404 | return false |
| 405 | } |
| 406 | |
| 407 | func (c *checker) fetchDatabaseUri(ctx context.Context, s config.SQL) (string, func() error, error) { |
| 408 | cleanup := func() error { |