Cloudflare D1 (Effect's @effect/sql-d1): an SqlClient with
SQLite's SQL over D1's HTTP API, sent with the HttpClient in context::
from pyfect.http import httpx_client
from pyfect.sql import d1
layer = d1.layer(
d1.D1ClientConfig(account_id=..., database_id=..., api_token=fx.redacted.make(token))
).pipe(fx.provide(httpx_client.layer))client:D1Client(anSqlClientwithbatch, itsconfigandapi),make,layer,layer_config,layer_fromconfig:D1ClientConfigapi:D1Api, the HTTP API underneath (query,raw), its results (D1Result,D1RawResult,D1Meta) andD1ApiError
D1 has no transactions, so with_transaction and pyfect.sql.migrator
(which runs migrations in one) die with NotImplementedError, as in
Effect; apply migrations with wrangler d1 migrations apply.
Re-exports#
- From
pyfect.sql.d1.api:D1Api,D1ApiError,D1Message,D1Meta,D1RawResult,D1Result - From
pyfect.sql.d1.client:D1Client,D1ClientService,layer,layer_config,layer_from,make - From
pyfect.sql.d1.config:D1ClientConfig