outerbase / sdk

Typescript ORM and automated model generation direct from your database schema. Supports Outerbase features for saved queries & AI.
https://outerbase.com
MIT License
12 stars 5 forks source link

Neon Serverless Connection #39

Closed Brayden closed 4 months ago

Brayden commented 4 months ago

Purpose

Supports using the native Neon drivers for interacting with Neon data sources.

Tasks

Verify

const neon = new NeonHttpConnection('postgresql://USER:PASSWORD@ep-damp-hill-a59vzq0g.us-east-2.aws.neon.tech/neondb?sslmode=require');
await neon.connect();
const db = Outerbase(neon);

// Chained query
let { data, query } = await db.selectFrom([
    { table: 'playing_with_neon', columns: ['id', 'name', 'value'] }
])
.where(equalsNumber('id', 1))
.query()

// Raw query
let { data } = await db.queryRaw('SELECT * FROM playing_with_neon WHERE id = $1', ['1']);

Before

After