Socket
Book a DemoInstallSign in
Socket

@spikedpunch/stacks-postgres

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spikedpunch/stacks-postgres

PostgresSQL plugin for `stacks`. The underlying implementation uses the [Kysely](https://github.com/koskimas/kysely) Postgres query builder. This was chosen to provide as much forward functionality as possible.

0.0.2
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

stacks-postgres

PostgresSQL plugin for stacks. The underlying implementation uses the Kysely Postgres query builder. This was chosen to provide as much forward functionality as possible.

Model Definitions


let model = stack.create.model('model', {
   name: '' 
})

model.symbols.push({
   name: 'postgres:
})

Model Symbols

NameRequiredTypeDescription
postgres:tablenameoptionalstringThe name of the Postgres Table. Defaultrs to the Model's name.
postgres:customoptionalfunction(builder: CreateTableBuilder<any, any>): Promise<CreateTableBuilder<any, any>>Allows you to fully customize the table creation process. This is a lambda function that provides you with the CreateTableBuilder Object in the underlying library.

Member Symbols

NameRequiredTypeDescription
postgres:datatypeoptionalstringThe Postgres Data Type, as specified here. If not provided the plugin will assign a default based on its type. See the Default Type Mapping table below.
postgres:columnnameoptionalstringThe name of the column for this Member
postgres:customcolumnoptionalfunction(builder: CreateTableBuilder<any, any>): Promise<CreateTableBuilder<any, any>>A custom column definition builder. This exposes the underlying builder to configure the column any way you need.

Examples

Default Type Mapping

JS TypePostgres TypeNotes
stringtext
numberinteger
booleanboolean
array[]Also supports List of Lists, ie int[][]
Object Reftable or composite typeWill use the Type's Table nme or Composite name

Store Context

TODO: Fill out

name: 'stacks:postgres',
version: this.version || 'version-not-set',
store: {
   config: this.config,
   db: this.context.db,
   tables: Array.from(this.context.tableMap.values())
}

Underlying Details

  • Search indexes are created on each table for the id column using btree.

FAQs

Package last updated on 04 Sep 2024

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.