feat: add @nicia-ai/typegraph/sqlite/libsql convenience export#80
Merged
Conversation
edf4271 to
c290d51
Compare
Add first-class libsql backend with automatic DDL execution, async execution profile, and caller-retained client ownership for shared-driver setups. Fix Drizzle bugs affecting all async SQLite drivers. New export: - createLibsqlBackend() at @nicia-ai/typegraph/sqlite/libsql - Caller owns the client lifecycle, enabling shared connections - @libsql/client added as optional peer dependency Bug fixes: - bootstrapTables() now awaits db.run() for async drivers - execGet uses db.all()[0] instead of db.get() to avoid Drizzle normalizeRow crash on empty results (drizzle-team/drizzle-orm#1049) - All SQLite exec helpers use unconditional await instead of instanceof Promise check (drizzle-team/drizzle-orm#2275) Internal: - Extract wrapWithManagedClose() shared helper - Widen shared test suite factories to accept async backends - libsql runs full adapter + integration suites (214 tests) - Document libsql support in backend-setup, getting-started, limitations
c290d51 to
1d86604
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a first-class libsql backend export at
@nicia-ai/typegraph/sqlite/libsql.createLibsqlBackend(client, options?)— async factory that wraps@libsql/clientwith automatic DDL execution, correct async execution profile (isSync: false,transactionMode: "drizzle"), and managed lifecycle (idempotent close that also closes the client)db.get()crash on empty results → usedb.all()[0](drizzle-team/drizzle-orm#1049)instanceof Promisefails for SQLiteRaw thenables → unconditionalawait(drizzle-team/drizzle-orm#2275)wrapWithManagedClose()helper extracted from duplicated pattern inlocal.tsand newlibsql.ts@libsql/clientadded as optional peer dependencyCloses #79