跳转到内容

virtuals/sdk/effect/db

此内容尚不支持你的语言。

Defined in: studiocms/packages/studiocms/src/virtuals/sdk/effect/db.ts:27^

Provides an Effect-based service wrapper for interacting with an AstroDB database client.

This service exposes utility functions for executing queries, managing transactions, and composing database effects using the Effect system. It handles error mapping for LibSQL client errors and supports transactional execution with proper error propagation.

const result = await AstroDB.execute((client) => client.query('SELECT * FROM users'));
  • any

new AstroDB(): AstroDB;

AstroDB

Effect.Service<AstroDB>()('studiocms/sdk/effect/db/AstroDB', {
effect: Effect.gen(function () {
const db = client;
const { execute, makeQuery } = yield drizzleDBClientLive({ drizzle: db });
return {
db,
execute,
makeQuery,
};
}),
}).constructor

Re-exports LibSQLClientError