Saltearse al contenido

virtuals/sdk/effect/db

Esta página aún no está disponible en tu idioma.

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