_Zaizen_
_Zaizen_
Explore posts from servers
BABetter Auth
Created by _Zaizen_ on 2/18/2025 in #help
Sending a mail after email verification
Hey everyone, is there a way to send a mail when the email verification is compelted successfully? Thanks
2 replies
BABetter Auth
Created by _Zaizen_ on 2/4/2025 in #help
useSession cannot reach get-session endpoint
Hey there I'm using React in the frontend side and elysia in the backend with postgres as the driver (with bun sql). The login ad registration through email works correctly but when the user is redirected to the dashboard where I call the useSession the endpoint gives not_found. While working on my localhost everything works fine, this happens only in prod.
46 replies
DTDrizzle Team
Created by _Zaizen_ on 1/29/2025 in #help
Uuid always the same with Bun randomUUIDv7() (?)
Hey there I'm working on a sqlite db and have this table: const session = sqliteTable("session", { id: integer("id", { mode: "number" }).primaryKey({ autoIncrement: true }), ipAddress: text("ip_address").notNull(), userAgent: text("user_agent").notNull(), startedAt: integer("started_at", { mode: "number" }) .default(sql(strftime('%s', 'now'))) .notNull(), endedAt: integer("ended_at", { mode: "number" }), uuid: text("uuid").default(randomUUIDv7()).notNull(), }) When I insert a new session const s = await db.insert(session).values({ ipAddress: ip, userAgent: headers["user-agent"] || "unknown", }).returning({ uuid: session.uuid }) The uuid is always the same. Looking into the sqlite DB I can confirm it's the same. What am I doing wrong?
7 replies
DTDrizzle Team
Created by _Zaizen_ on 6/4/2024 in #help
PGLite indexedDB migration error
hey everyone I'm trying to use PGlite with indexed db as a storage. It seems like the migrate function has an error though: Here's a snippet from my react app: import * as schema from "./drizzle/schema.js"; ..... useEffect(() => { const initDb = async () => { const bufferDb = new PGlite("idb://test"); await bufferDb.waitReady; const bufferDrizzle = drizzle(bufferDb, { schema }); const migrationPath = "./src/drizzle/migrations"; await migrate(bufferDrizzle, { migrationsFolder: migrationPath }); setDb(bufferDrizzle); }; initDb(); }, []); In the browser debug console: Uncaught (in promise) TypeError: import_node_fs.default.existsSync is not a function readMigrationFiles migrator.ts:40 migrate migrator.ts:9 initDb App.jsx:20 App2 App.jsx:24 React 8 workLoop scheduler.development.js:266 flushWork scheduler.development.js:239 performWorkUntilDeadline scheduler.development.js:533 js scheduler.development.js:571 js scheduler.development.js:633 __require chunk-LNEMQRCO.js:9 js index.js:6 __require chunk-LNEMQRCO.js:9 React 2 __require chunk-LNEMQRCO.js:9 js React __require chunk-LNEMQRCO.js:9 js React __require chunk-LNEMQRCO.js:9 <anonymous> react-dom_client.js:38 Is the migrate non compatible with pglite? Thanks
1 replies
DTDrizzle Team
Created by _Zaizen_ on 3/28/2024 in #help
Issue with CURRENT_TIMESTAMP bun:sqlite
I have the following table: export const token = sqliteTable("token", { token: text("token").notNull().primaryKey(), usage_started: integer("usage_started", { mode: "boolean" }) .notNull() .default(false), usage_started_timestamp: integer("usage_started_timestamp", { mode: "timestamp_ms", }), used: integer("used", { mode: "boolean" }).notNull().default(false), used_timestamp: integer("used_timestamp", { mode: "timestamp_ms" }), expiration_timestamp: integer("expiration_timestamp", { mode: "timestamp_ms", }) .notNull() .default(-1), instance_id: integer("instance_id") .notNull() .references(() => instance.id), }); When running await db.insert(token).values({ token: tokenId, instance_id: instanceId, expiration_timestamp: currentTimestamp + 86400000, });
2 replies