Hypex
Hypex
Explore posts from servers
DTDrizzle Team
Created by Hypex on 1/16/2025 in #help
this.client.migrate is not a function
Here's my drizzle.config.ts:
import { defineConfig } from 'drizzle-kit';
if (!process.env.DATABASE_URL) throw new Error('DATABASE_URL is not set');

export default defineConfig({
schema: './src/lib/server/db/schema.ts',

dbCredentials: {
url: process.env.DATABASE_URL
},

verbose: true,
strict: true,
dialect: 'sqlite'
});
import { defineConfig } from 'drizzle-kit';
if (!process.env.DATABASE_URL) throw new Error('DATABASE_URL is not set');

export default defineConfig({
schema: './src/lib/server/db/schema.ts',

dbCredentials: {
url: process.env.DATABASE_URL
},

verbose: true,
strict: true,
dialect: 'sqlite'
});
And here's my schema file:
import { sqliteTable, text } from "drizzle-orm/sqlite-core";

export const slackSessionsTable = sqliteTable("slack_sessions", {
sessionId: text().primaryKey(),
userId: text().notNull(),
name: text().notNull(),
firstName: text().notNull(),
pfp: text().notNull(),
email: text().notNull(),
});

export type SlackSession = typeof slackSessionsTable.$inferSelect;
import { sqliteTable, text } from "drizzle-orm/sqlite-core";

export const slackSessionsTable = sqliteTable("slack_sessions", {
sessionId: text().primaryKey(),
userId: text().notNull(),
name: text().notNull(),
firstName: text().notNull(),
pfp: text().notNull(),
email: text().notNull(),
});

export type SlackSession = typeof slackSessionsTable.$inferSelect;
When I run drizzle-kit generate everything is fine, but when I run drizzle-kit migrate, I get this error:
[⣷] applying migrations...TypeError: this.client.migrate is not a function
at LibSQLSession.migrate (/home/skyfall/Projects/high-seas-sveltekit/node_modules/src/libsql/session.ts:90:42)
at migrate (/home/skyfall/Projects/high-seas-sveltekit/node_modules/src/libsql/migrator.ts:46:19)
[⣷] applying migrations...TypeError: this.client.migrate is not a function
at LibSQLSession.migrate (/home/skyfall/Projects/high-seas-sveltekit/node_modules/src/libsql/session.ts:90:42)
at migrate (/home/skyfall/Projects/high-seas-sveltekit/node_modules/src/libsql/migrator.ts:46:19)
How can I fix this?
1 replies
CDCloudflare Developers
Created by Hypex on 1/1/2025 in #pages-help
"Error: [unenv] crypto.createCipheriv is not implemented yet" when using Auth.js
Using GitHub OAuth with Auth.js and SvelteKit, I get this error when an user clicks "Sign in on GitHub":
[auth][error] Error: [unenv] crypto.createCipheriv is not implemented yet!
[auth][error] Error: [unenv] crypto.createCipheriv is not implemented yet!
Is there any way around this? (except moving to another platform :/)
2 replies
CDCloudflare Developers
Created by Hypex on 10/11/2024 in #pages-help
Alternatives to DOMPurify?
Both DOMPurify and isometric-dompurify don't work and show a "ReferenceError: window is not defined" error. What alternatives can I use that work with Pages?
2 replies
DTDrizzle Team
Created by Hypex on 10/5/2024 in #help
How to generate type for individual items?
I have a schema.ts here:
import { sql } from 'drizzle-orm';
import { text, integer, sqliteTable } from 'drizzle-orm/sqlite-core';

export const comments = sqliteTable('comments', {
url: text('url'),
authorId: text('author_id').notNull(),
upvotes: integer('upvotes').notNull().default(0),
downvotes: integer('downvotes').notNull().default(0),
parentId: text('parent_id'), // For replies, null if it's a top-level comment
timestamp: text('timestamp')
.notNull()
.default(sql`CURRENT_TIMESTAMP`)
});

export const users = sqliteTable('users', {
id: text('id').primaryKey(),
name: text('name').notNull(),
email: text('email').notNull().unique()
});
import { sql } from 'drizzle-orm';
import { text, integer, sqliteTable } from 'drizzle-orm/sqlite-core';

export const comments = sqliteTable('comments', {
url: text('url'),
authorId: text('author_id').notNull(),
upvotes: integer('upvotes').notNull().default(0),
downvotes: integer('downvotes').notNull().default(0),
parentId: text('parent_id'), // For replies, null if it's a top-level comment
timestamp: text('timestamp')
.notNull()
.default(sql`CURRENT_TIMESTAMP`)
});

export const users = sqliteTable('users', {
id: text('id').primaryKey(),
name: text('name').notNull(),
email: text('email').notNull().unique()
});
How do I generate individual Comment and User types? Thanks!
6 replies
CDCloudflare Developers
Created by Hypex on 7/6/2024 in #pages-help
Custom domain not working
I set my custom domain to skyfall.dev, but it's been around an hour and there is an error page saying "ERR_NAME_NOT_RESOLVED". What do I do? - skyfalldev.pages.dev - Account ID: b7624c46ee3377d0b12e2bf893c00685
2 replies
CDCloudflare Developers
Created by Hypex on 6/24/2024 in #workers-help
How do I get element innerHTML using HTMLRewriter?
Here's my code:
const rewriter = new HTMLRewriter().on('#element', {
element(element) {
// Somehow get element innerHTML
}
}).transform(new Response(html))
const rewriter = new HTMLRewriter().on('#element', {
element(element) {
// Somehow get element innerHTML
}
}).transform(new Response(html))
How do I get the element's innerHTML?
2 replies
CDCloudflare Developers
Created by Hypex on 1/10/2024 in #pages-help
Pages is installing bun 1.0.1
The latest version is 1.0.21. This causes my build to fail. Account ID: b7624c46ee3377d0b12e2bf893c00685
2 replies
LTLeaning Technologies
Created by Hypex on 11/5/2023 in #support
Can I try CheerpX?
I know it's not fully ready yet, but I think it's fine for my use cases in its current state
19 replies