jj8822
jj8822
Explore posts from servers
DTDrizzle Team
Created by jj8822 on 6/8/2024 in #help
Can't migrate to Xata, error: schema "drizzle" does not exist
Maybe a bug? Work fine with Neon but not Xata, Studio and Push command work great but with migrate I got error: schema "drizzle" does not exist here is my configuration
import { defineConfig } from "drizzle-kit";
import { getXataClient } from "./src/xata";
const xata = getXataClient();
export default defineConfig({
dialect: "postgresql",
schema: "./src/schema.ts",
out: "./drizzle",
dbCredentials: {
url: xata.sql.connectionString,
},
});
import { defineConfig } from "drizzle-kit";
import { getXataClient } from "./src/xata";
const xata = getXataClient();
export default defineConfig({
dialect: "postgresql",
schema: "./src/schema.ts",
out: "./drizzle",
dbCredentials: {
url: xata.sql.connectionString,
},
});
my schema
import { integer, pgTable, serial, text, timestamp } from "drizzle-orm/pg-core";

export const usersTable = pgTable("users_table", {
id: serial("id").primaryKey(),
name: text("name").notNull(),
age: integer("age").notNull(),
email: text("email").notNull().unique(),
});

export const postsTable = pgTable("posts_table", {
id: serial("id").primaryKey(),
title: text("title").notNull(),
content: text("content").notNull(),
userId: integer("user_id")
.notNull()
.references(() => usersTable.id, { onDelete: "cascade" }),
createdAt: timestamp("created_at").notNull().defaultNow(),
updatedAt: timestamp("updated_at")
.notNull()
.$onUpdate(() => new Date()),
});

export type InsertUser = typeof usersTable.$inferInsert;
export type SelectUser = typeof usersTable.$inferSelect;

export type InsertPost = typeof postsTable.$inferInsert;
export type SelectPost = typeof postsTable.$inferSelect;
import { integer, pgTable, serial, text, timestamp } from "drizzle-orm/pg-core";

export const usersTable = pgTable("users_table", {
id: serial("id").primaryKey(),
name: text("name").notNull(),
age: integer("age").notNull(),
email: text("email").notNull().unique(),
});

export const postsTable = pgTable("posts_table", {
id: serial("id").primaryKey(),
title: text("title").notNull(),
content: text("content").notNull(),
userId: integer("user_id")
.notNull()
.references(() => usersTable.id, { onDelete: "cascade" }),
createdAt: timestamp("created_at").notNull().defaultNow(),
updatedAt: timestamp("updated_at")
.notNull()
.$onUpdate(() => new Date()),
});

export type InsertUser = typeof usersTable.$inferInsert;
export type SelectUser = typeof usersTable.$inferSelect;

export type InsertPost = typeof postsTable.$inferInsert;
export type SelectPost = typeof postsTable.$inferSelect;
2 replies
CDCloudflare Developers
Created by jj8822 on 8/12/2023 in #workers-help
my Workers KV have very high latency
is it normal? is altime 800ms ~ 1100ms with postman and more than 1000ms with python i'm using Api with bearer auth https://developers.cloudflare.com/api/operations/workers-kv-namespace-read-key-value-pair
5 replies
CDCloudflare Developers
Created by jj8822 on 8/10/2023 in #pages-help
how to integrate function in Next.js ssg app folder project
Hello ,i have write in api/route.js but the result will prefetched get same result using export const runtime = "edge"; can we have next.js without ssr but with dynamic api?
8 replies