MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / isInMemorySQLite

Function isInMemorySQLite

internal/cmd/vet.go:395–405  ·  view source on GitHub ↗

isInMemorySQLite checks if a SQLite URI refers to an in-memory database

(uri string)

Source from the content-addressed store, hash-verified

393
394// isInMemorySQLite checks if a SQLite URI refers to an in-memory database
395func 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
407func (c *checker) fetchDatabaseUri(ctx context.Context, s config.SQL) (string, func() error, error) {
408 cleanup := func() error {

Callers 1

checkSQLMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected