1.3.0 • Published 8 months ago

@storecraft/database-neon v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Storecraft Neon (cloud postgres) Database support

Official Neon driver for StoreCraft on any platforms. Supports two serverless drivers: 1. NeonServerless - serverless neon, supports interactive transactions over websockets. 2. 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>
1.0.17

9 months ago

1.0.16

10 months ago

1.2.5

9 months ago

1.3.0

8 months ago

1.0.15

10 months ago

1.0.14

10 months ago

1.0.13

10 months ago

1.0.12

10 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.9

11 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.2

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago