thorwebdev
thorwebdev
DDeno
Created by thorwebdev on 12/11/2023 in #help
How do I run an npm script with multiple dependencies, e.g. `drizzle-kit generate:pg`?
I thought about wrapping it into a task "generate": "deno run -A npm:drizzle-kit generate:pg" in the deno.json file, but I'm getting
Task generate deno run -A npm:drizzle-kit generate:pg
error: Uncaught Error: Cannot find module 'drizzle-orm/pg-core'
Task generate deno run -A npm:drizzle-kit generate:pg
error: Uncaught Error: Cannot find module 'drizzle-orm/pg-core'
in that case
4 replies
DDeno
Created by thorwebdev on 1/17/2023 in #help
example of kysely running on deno deploy?
Deno Deploy awesomely can connect to postgres directly from the edge https://deno.com/blog/deploy-postgres-at-the-edge so I was hoping to use https://github.com/koskimas/kysely#deno Was trying to make it work like this:
import { Pool } from 'https://deno.land/x/pg@v0.6.1/mod.ts'
import { serve } from 'https://deno.land/std@0.114.0/http/server.ts'
import {
Kysely,
PostgresDialect,
Generated,
ColumnType,
Selectable,
Insertable,
Updateable,
} from 'https://esm.sh/kysely@0.23.4'

console.log(`Function "kysely-postgres" up and running!`)

interface AnimalTable {
id: Generated<number>
animal: string
created_at: Date
}

// Keys of this interface are table names.
interface Database {
animal: AnimalTable
}

// You'd create one of these when you start your app.
const db = new Kysely<Database>({
// Use MysqlDialect for MySQL and SqliteDialect for SQLite.
dialect: new PostgresDialect({
// @ts-ignore
pool: new Pool({
user: 'postgres',
hostname: 'db.bljghubhkofddfrezkhn.supabase.co',
database: 'postgres',
password: Deno.env.get('DB_PASSWORD')!,
port: 5432,
}),
}),
})
import { Pool } from 'https://deno.land/x/pg@v0.6.1/mod.ts'
import { serve } from 'https://deno.land/std@0.114.0/http/server.ts'
import {
Kysely,
PostgresDialect,
Generated,
ColumnType,
Selectable,
Insertable,
Updateable,
} from 'https://esm.sh/kysely@0.23.4'

console.log(`Function "kysely-postgres" up and running!`)

interface AnimalTable {
id: Generated<number>
animal: string
created_at: Date
}

// Keys of this interface are table names.
interface Database {
animal: AnimalTable
}

// You'd create one of these when you start your app.
const db = new Kysely<Database>({
// Use MysqlDialect for MySQL and SqliteDialect for SQLite.
dialect: new PostgresDialect({
// @ts-ignore
pool: new Pool({
user: 'postgres',
hostname: 'db.bljghubhkofddfrezkhn.supabase.co',
database: 'postgres',
password: Deno.env.get('DB_PASSWORD')!,
port: 5432,
}),
}),
})
But am getting Unknown Authentication type, code: 10, message: SCRA
5 replies