Socket
Book a DemoInstallSign in
Socket

@storecraft/database-neon

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storecraft/database-neon

`Storecraft` database driver for `Neon` over http

latest
Source
npmnpm
Version
1.3.0
Version published
Maintainers
1
Created
Source

Storecraft Neon (cloud postgres) Database support


Official Neon driver for StoreCraft on any platforms. Supports two serverless drivers:

  • NeonServerless - serverless neon, supports interactive transactions over websockets.
  • NeonHttp - serverless http only neon, supports NON-interactive transactions, only batches over HTTP.
npm i @storecraft/database-neon

Setup

  • First, login to your neon account account.
  • Create a database.
  • Copy the connection string.

usage

import 'dotenv/config';
import http from "node:http";
import { App } from '@storecraft/core'
import { NodePlatform } from '@storecraft/core/platform/node';
import { NeonHttp, NeonServerless } from '@storecraft/database-neon'
import { NodeLocalStorage } from '@storecraft/core/storage/node'
import { migrateToLatest } from '@storecraft/database-neon/migrate.js'

const app = new App(
  {
    auth_admins_emails: ['admin@sc.com'],
    auth_secret_access_token: 'auth_secret_access_token',
    auth_secret_refresh_token: 'auth_secret_refresh_token'
  }
)
.withPlatform(new NodePlatform())
.withDatabase(
  new NeonHttp(
    { 
      connectionString: process.env.NEON_CONNECTION_URL
    }
  )
)
.withStorage(new NodeLocalStorage('storage'))
.init();

await migrateToLatest(app.__show_me_everything.db, false);
await app.__show_me_everything.vector_store.createVectorIndex();

http.createServer(app.handler).listen(
  8000,
  () => {
    app.print_banner('http://localhost:8000');
  }
); 

Author: Tomer Shalev <tomer.shalev@gmail.com>

Keywords

commerce

FAQs

Package last updated on 27 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts