We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.8.4
import { Schema } from "@effect/schema"; import * as PgDrizzle from "@effect/sql-drizzle/Pg"; import "dotenv/config"; import { eq } from "drizzle-orm"; import { Effect } from "effect"; import { DatabaseLive } from "./database"; import { SelectUserSchema, userTable } from "./schema"; Effect.gen(function* () { const db = yield* PgDrizzle.PgDrizzle; const email = "johndoe@acme.com"; yield* db.delete(userTable).where(eq(userTable.email, email)); yield* db.insert(userTable).values({ email }); const user = (yield* db.select().from(userTable)).at(0); if (user) { console.log(typeof user.id, user.id); console.log(typeof user.createdAt, user.createdAt); console.log(typeof user.updatedAt, user.updatedAt); console.log(typeof user.deletedAt, user.deletedAt); Schema.decodeUnknownSync(SelectUserSchema)(user); } }).pipe(Effect.provide(DatabaseLive), Effect.runPromise);
When using drizzle-orm directly it outputs:
string user_b329aa7b399b4f5b8b11870f3b25f66d string 2024-09-25 08:48:38.961462+02 string 2024-09-25 08:48:38.961462+02 object null
string user_b329aa7b399b4f5b8b11870f3b25f66d object 2024-09-25T06:48:38.961Z object 2024-09-25T06:48:38.961Z object null
https://github.com/amosbastian/effect-drizzle
The text was updated successfully, but these errors were encountered:
tim-smart
No branches or pull requests
What version of Effect is running?
3.8.4
What steps can reproduce the bug?
What is the expected behavior?
When using drizzle-orm directly it outputs:
What do you see instead?
Additional information
https://github.com/amosbastian/effect-drizzle
The text was updated successfully, but these errors were encountered: