villainy
Explore posts from serversDTDrizzle Team
•Created by villainy on 1/20/2024 in #help
Error: Failed to collect page data for /api/company-search/[name]
// db
import { drizzle } from "drizzle-orm/libsql";
import { createClient } from "@libsql/client/web";
const client = createClient({
url: process.env.DATABASE_URL,
authToken: process.env.DATABASE_AUTH_TOKEN,
});
export const db = drizzle(client);
// norwegianOrgs.ts
import { text, sqliteTable, index } from "drizzle-orm/sqlite-core";
export const norwegianOrgs = sqliteTable(
"norwegianOrgs",
{
orgType: text("orgType").notNull().unique(),
orgName: text("orgName").notNull(),
},
(table) => {
return {
orgType_idx: index("orgType_idx").on(table.orgType),
};
}
);
// company search
import { db } from "@/app/db";
import { norwegianOrgs } from "@/app/db/schema/norwegianOrgs";
const norData = await db.select().from(norwegianOrgs).all();
console.log(norData);
// db
import { drizzle } from "drizzle-orm/libsql";
import { createClient } from "@libsql/client/web";
const client = createClient({
url: process.env.DATABASE_URL,
authToken: process.env.DATABASE_AUTH_TOKEN,
});
export const db = drizzle(client);
// norwegianOrgs.ts
import { text, sqliteTable, index } from "drizzle-orm/sqlite-core";
export const norwegianOrgs = sqliteTable(
"norwegianOrgs",
{
orgType: text("orgType").notNull().unique(),
orgName: text("orgName").notNull(),
},
(table) => {
return {
orgType_idx: index("orgType_idx").on(table.orgType),
};
}
);
// company search
import { db } from "@/app/db";
import { norwegianOrgs } from "@/app/db/schema/norwegianOrgs";
const norData = await db.select().from(norwegianOrgs).all();
console.log(norData);
7 replies