Skip to main content
zerotal

Documentation


Documentation / zerotal / orm / SQLInstance

Interface: SQLInstance()

Defined in: packages/orm/src/db/sql-types.ts:8

The shape of a Bun SQL connection as this ORM uses it: a callable tagged-template that runs a query, plus begin() for transactions and end() to close.

Exported (rather than an ambient global) so consumers that pull this package's source into their type program resolve it through the import graph.

SQLInstance<T>(strings, ...values): Promise<T[]>

Defined in: packages/orm/src/db/sql-types.ts:9

The shape of a Bun SQL connection as this ORM uses it: a callable tagged-template that runs a query, plus begin() for transactions and end() to close.

Exported (rather than an ambient global) so consumers that pull this package's source into their type program resolve it through the import graph.

Type Parameters

T

T = Record<string, unknown>

Parameters

strings

TemplateStringsArray

values

...unknown[]

Returns

Promise<T[]>

Methods

begin()

begin<T>(fn): Promise<T>

Defined in: packages/orm/src/db/sql-types.ts:10

Type Parameters

T

T

Parameters

fn

(tx) => Promise<T>

Returns

Promise<T>


end()

end(): Promise<void>

Defined in: packages/orm/src/db/sql-types.ts:11

Returns

Promise<void>