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

Neon Serverless Connection #39

Merged
merged 5 commits into from
Jul 10, 2024
Merged

Neon Serverless Connection #39

merged 5 commits into from
Jul 10, 2024

Conversation

Brayden
Copy link
Member

@Brayden Brayden commented Jun 25, 2024

Purpose

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

Tasks

  • Add support for the Neon serverless driver
  • Use web sockets for communication
  • Convert query params to Postgres positional (e.g. $1, $2, etc)
  • Write unit tests

Verify

  • Add a Neon connection type to the playground (see sample code below)
  • Try to execute a chained query
  • Try to run a raw query with parameters
const neon = new NeonHttpConnection('postgresql://USER:[email protected]/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

@Brayden Brayden self-assigned this Jun 25, 2024
@Brayden Brayden added the enhancement New feature or request label Jun 25, 2024
@Brayden Brayden merged commit b850831 into main Jul 10, 2024
1 check passed
@Brayden Brayden deleted the bwilmoth/neon-http branch July 10, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants