Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in docs examples #57

Open
1 task done
kingyue737 opened this issue Mar 1, 2024 · 1 comment
Open
1 task done

Error in docs examples #57

kingyue737 opened this issue Mar 1, 2024 · 1 comment

Comments

@kingyue737
Copy link

kingyue737 commented Mar 1, 2024

Describe the change

version: db0 v0.1.3

  1. In many examples, sql which does not exist is imported from 'db0'
  2. 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",
  }),
);
  1. drizzle can only be imported from db0/integrations/drizzle/index instead of db0/integrations/drizzle stated in the docs, maybe an issue of exports in package.json (moduleResolution of my project is bundler 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
Copy link

Bump, still out of date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants