Aryxst
Aryxst
Explore posts from servers
DTDrizzle Team
Created by Aryxst on 5/16/2024 in #help
LibsqlError: URL_INVALID: The URL is not in a valid format
Out of nowhere I started getting this error, whats even weiirder is that it only occurs on one route. /posts/create
16 replies
DTDrizzle Team
Created by Aryxst on 5/13/2024 in #help
Setting default timestamp in user table
So Im using turso with sqlite and out of nowhere i have been issuing this issue with my user table, im using nextauthjs
import { sql } from 'drizzle-orm';
import { sqliteTable, text, primaryKey, integer, int } from 'drizzle-orm/sqlite-core';
import type { AdapterAccountType } from 'next-auth/adapters';
import { createId } from '@paralleldrive/cuid2';

export const user = sqliteTable('user', {
id: text('id')
.primaryKey()
.$defaultFn(() => createId()),
name: text('name'),
email: text('email').notNull(),
emailVerified: integer('emailVerified', { mode: 'timestamp_ms' }),
image: text('image'),
role: text('role').$type<'USER' | 'ADMIN'>().notNull().default('USER'),
joinedAt: integer('joinedAt', { mode: 'timestamp_ms' })
.notNull()
.$defaultFn(() => sql`(unixepoch() * 1000)`),
});
import { sql } from 'drizzle-orm';
import { sqliteTable, text, primaryKey, integer, int } from 'drizzle-orm/sqlite-core';
import type { AdapterAccountType } from 'next-auth/adapters';
import { createId } from '@paralleldrive/cuid2';

export const user = sqliteTable('user', {
id: text('id')
.primaryKey()
.$defaultFn(() => createId()),
name: text('name'),
email: text('email').notNull(),
emailVerified: integer('emailVerified', { mode: 'timestamp_ms' }),
image: text('image'),
role: text('role').$type<'USER' | 'ADMIN'>().notNull().default('USER'),
joinedAt: integer('joinedAt', { mode: 'timestamp_ms' })
.notNull()
.$defaultFn(() => sql`(unixepoch() * 1000)`),
});
2 replies