Error in docs examples
Closed this issue · 2 comments
kingyue737 commented
Describe the change
version: db0 v0.1.3
- In many examples,
sql
which does not exist is imported from 'db0' bindingName
in the example of PostgreSQL does not exist in the option
- import { createDatabase, sql } from "db0";
+ import { createDatabase } from "db0";
import postgresql from "db0/connectors/postgresql";
const db = createDatabase(
postgresql({
- bindingName: "DB",
}),
);
- drizzle can only be imported from
db0/integrations/drizzle/index
instead ofdb0/integrations/drizzle
stated in the docs, maybe an issue ofexports
inpackage.json
(moduleResolution
of my project isbundler
which is the default in nuxt)?
import { createDatabase } from "db0";
import sqlite from "db0/connectors/better-sqlite3";
- import { drizzle } from "db0/integrations/drizzle";
+ import { drizzle } from "db0/integrations/drizzle/index";
import { sqliteTable, text, numeric } from "drizzle-orm/sqlite-core";
// Initialize DB instance
// You can use any other available connector
const db = createDatabase(sqlite({}));
URLs
https://db0.unjs.io/connectors/bun
https://db0.unjs.io/connectors/cloudflare
https://db0.unjs.io/connectors/libsql
https://db0.unjs.io/connectors/sqlite
https://db0.unjs.io/connectors/vercel
https://db0.unjs.io/connectors/postgresql
https://db0.unjs.io/integrations/drizzle
Additional information
- Would you be willing to help?
masamesa commented
Bump, still out of date.