MCPcopy
hub / github.com/kenn-io/msgvault / NewEngine

Function NewEngine

internal/query/postgres.go:51–56  ·  view source on GitHub ↗

NewEngine picks the appropriate engine for the given database. isPostgres selects between PostgreSQLQueryDialect (true) and SQLiteQueryDialect (false). This is the preferred entry point for callers that have a Store with an unknown backend — pass store.IsPostgres() as the flag. The return type is t

(db *sql.DB, isPostgres bool)

Source from the content-addressed store, hash-verified

49// The return type is the Engine interface so the SQLite-only TextEngine
50// is hidden when isPostgres is true.
51func NewEngine(db *sql.DB, isPostgres bool) Engine {
52 if isPostgres {
53 return NewPostgreSQLEngine(db)
54 }
55 return NewSQLiteEngine(db)
56}

Calls 2

NewPostgreSQLEngineFunction · 0.85
NewSQLiteEngineFunction · 0.85