npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@spikedpunch/stacks-postgres

v0.0.2

Published

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.

Downloads

75

Readme

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

| Name | Required | Type | Description | |-|-|-|-| | postgres:tablename | optional | string | The name of the Postgres Table. Defaultrs to the Model's name. | | postgres:custom | optional | function(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

| Name | Required | Type | Description | |-|-|-|-| | postgres:datatype | optional | string | The 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:columnname | optional | string | The name of the column for this Member | | postgres:customcolumn | optional | function(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 Type | Postgres Type | Notes | |-|-|-| | string | text | | number | integer | | boolean | boolean | | array | [] | Also supports List of Lists, ie int[][] | | Object Ref | table or composite type | Will 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.