mootshrooms
mootshrooms
TTCTheo's Typesafe Cult
Created by mootshrooms on 6/25/2023 in #questions
Error importing @planetscale/database
I did more testing without drizzle in the same project directory with the following code:
import "dotenv/config"
import { connect } from '@planetscale/database'

const conn = connect({
host: process.env.DB_HOST,
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
});

(async () => {
const results = conn.execute('select 1 from dual where 1=?', [1]);
console.log(await results)
})();
import "dotenv/config"
import { connect } from '@planetscale/database'

const conn = connect({
host: process.env.DB_HOST,
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
});

(async () => {
const results = conn.execute('select 1 from dual where 1=?', [1]);
console.log(await results)
})();
Based on code from: https://github.com/planetscale/database-js But got the same error. Therefore it seems like it's purely an issue with the way I am using the @planetscale/database module. I think it might be an issue with my tsconfig target. Does this seem like a likely culprit? Any recommendations on fixes or where I may be able to find fixes?
2 replies