1.0.1 • Published 12 months ago

fnbkt-ui-nuxt v1.0.1

Weekly downloads
-
License
-
Repository
-
Last release
12 months ago

fnb-pg-util-ui

Look at the Nuxt 3 documentation to learn more.

Setup

Make sure to install the dependencies:

# pnpm
pnpm install --shamefully-hoist

Development Server

Start the development server on http://localhost:3000

npm run dev

Check out the deployment documentation for more information.

Environment Setup

optionally create a .env file in the new-db-project directory

# .env
FNBKT_DB_OWNER_CONNECTION postgres://postgres:1234@0.0.0.0/postgres

the above value will be used as a default. so if you want to use docker to run postgres, a command such as this will get you going quickly.

# run-postgres-docker.sh
docker run --rm --name pg14 --shm-size=1g -e POSTGRES_PASSWORD=1234 -d -p 5432:5432 -v $HOME/pg/data-14:/var/lib/postgresql/data  postgres

$HOME/pg/data-14 should be modified to wherever you prefer the data volume to live.

fnb-pg-util will use a specified database name root to create and manage the following databases on the specified server:

Run with npx NOT YET PUBLISHED TO NPM - COMING SOON

To run function-bucket, you only need to provide a FNBKT_DB_OWNER_CONNECTION environment variable, which will default to postgres://postgres:1234@0.0.0.0/postgres if you don't.

mkdir new-db-project
cd new-db-project
npx fnb

Production

Build the application for production:

npm run build

Locally preview production build:

npm run preview

Motivation

functioN_Bucket is a proof of concept exploring a new approach to developing postgres databases that provides immediate unit-testing feedback as you build. With approaches that leverage javascript testing frameworks (jest, mocha), there is a lot of extra tooling involved that gets in the way of database development. Even with a tool such as pgTap, there are a number of lower-level hoops that a postgres developer must jump through before they are writing useful code. (pgTap and sqitch are the good stuff, tho...)

Inspired by graphile-migrate's approach of reconstituting a testing database from a baseline, functioN_Bucket encourages a package-based release approach that manages unit-test and ui-dev database versions and associated assets.

The initial version manages generated json files that can be included in a git repository. However, this is ultimately not the optimal method for managing assets. Soon I intend to implement the core fnb-pg-util library as postgres database. The UI will be rewired accordingly and extended to allow for multiple projects to be managed, etc. This is the natural next evolution of the tool, and it will be accomplished by building the database with the tool.

Once the database-backed version is complete, it could be deployed in most any scenario. For instance, a GCP Cloud Run service and Cloud SQL instance is all that would be needed to get going.