Giter Club home page Giter Club logo

launchql

Build Status

webincubator

Create high-performance APIs with GraphQL and Postgres

introduction

Create PostgreSQL sql code quickly and in a streamlined, versioned workflow.

launchql is a wrapper around sqitch to enable a sane workflow for sane database management.

  • write and deploy extensions that can be installed with CREATE EXTENSION
  • optionally deploy same source as sqitch modules (since some managed db providers don't allow custom extensions)
  • write/deploy a project full of many sqitch modules that cross-reference each other using dependency resolution for running deploy command in proper order, etc
  • pulling modules down (currently via npm) to make re-usability super easy

launchql

installation

Install psql

Install psql without actually running the database. On mac you can use

brew install libpq

Or you can install the full-blown postgres locally, but it is recommended that you shut the service down. You'll be using psql to connect to the postgres that runs inside of a docker container.

Install sqitch

https://sqitch.org/

mac users can use brew

brew install sqitch --with-postgres-support --without-postgresql

or for brew sqitch docs: https://github.com/sqitchers/homebrew-sqitch

Install the Template library from http://www.tt2.org/

sudo cpan Template

Install launchql globally

npm install -g @launchql/cli

Get the verification utils

https://github.com/pyramation/pg-utils

getting started

Initialize a project

lql init --bare
lql install

Now you should have a packages/ folder

cd packages/
mkdir myfirstmodule
cd myfirstmodule/
lql init

Now you can create some sql using sqitch!

lql generate schema
lql generate table

Deploy recursively, using all the required modules!

lql deploy --createdb --recursive

testing

To create a test, first cd into a sqitch module

cd packages/myfirstmodule
lql maketest

Then you can use jest via yarn to test your logic.

yarn test:watch

what's different

  • interactive shell
  • naming conventions
  • utility functions to create verify/revert functions for most types
  • bundled with templates for most common things:
column
extension
fixture
foreignKey
fullPolicy
grantAllTables
grantExecute
grantRole
grantSchema
grantTable
index
policy
procedure
role
rowLevelSecurity
schema
table
timestamps
trigger
type
uniqueIndex
utility
view

bundle an npm module

You can install an npm module and then bundle it for plv8

yarn add my-awesome-npm-module
lql bundle my-awesome-npm-module awesomeThing

Install some existing packages

lql install skitch-extension-verify
lql install skitch-extension-jobs

launchql's Projects

base32 icon base32

RFC4648 Base32 encode/decode in plpgsql

faker icon faker

create fake data in PostgreSQL

inflection icon inflection

inflection is a port of the functionality from Ruby on Rails' Active Support Inflection classes into PostgreSQL

jobs icon jobs

📚 postgres queue - jobs and job scheduling

launchql icon launchql

🚀 Launch High-performance GraphQL APIs

pg-proto-parser icon pg-proto-parser

a TypeScript project that parses pganalyze/libpg_query PostgreSQL Protocol Buffers (protobuf) definitions and generates TypeScript interfaces, utility functions, and JSON mappings for the enums defined in the protobuf schema

totp icon totp

TOTP implementation in pure PostgreSQL plpgsql

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.