Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@forty-boy/sql-cli
Advanced tools
A CLI for the @forty-boy/sql library.
npm install @forty-boy/sql-cli
OR yarn add @forty-boy/sql-cli
If you want to get started using @forty-boy/sql and @forty-boy/sql-cli here are the necessary steps to take to get your project functioning properly.
./src
).env
file within that folder for your forty configurations
FORTY_HOST=<YOUR-DB-HOST>
FORTY_DB=<YOUR-DB-NAME>
FORTY_USER=<YOUR-DB-USERNAME>
FORTY_PASS=<YOUR-DB-PASSWORD>
FORTY_COMPILED_DIR=<YOUR-COMPILED-CODE-FOLDER>
./src
folder run your @forty-boy/sql-cli commands. Such as
forty-sql migration:add users
database
with two sub-folders; migrations
and schemas
.forty-sql migration:up
./src
directory. This is important for forty-sql to find the right files.@forty-boy/sql-cli navigates this file structure and it's not magic. The CLI must know where to go and where files live to function properly. The reason the FORTY_COMPILED_DIR
environment variable is so important is because the library needs to know where your migration files are to run them.
My Personal Structure:
lib // Javascript
├───database
│ ├───migration
│ └───schema
│
src // TypeScript
└───database
├───migration
└───schema
forty-sql migration:up
forty-sql migration:down
forty-sql migration:undo
forty-sql migration:redo
FORTY_COMPILED_DIR
flag to point to your compilation folder. This will tell forty-sql
where your migrations are. See Project setup section for more details.forty-sql migration:add <migration-name> [--add | -a]
forty-sql migration:add <migration-name> [--update | -u]
forty-sql migration:add <migration-name> [--remove | -r]
forty-sql migration:add <migration-name> <action> [--table | -t] <table-name>
forty-sql migration:add users
forty-sql schema:add users
forty-sql migration:add <migration-name>
./database/migrations
and ./database/schemas
if they do not already exists and add the corresponding files w/ boilerplate.forty-sql migration:add users
will create the following:
./database/migrations/<timestamp>_users.ts
./database/schemas/User.schema.ts
forty-sql migration:up
forty-sql migration:down
forty-sql migration:undo
forty-sql migration:red
forty-sql schema:add <schema-name>
./database/schemas
if it does not already exist and the corresponding file w/ boilerplate.forty-sql schema:add users
will create the following:
./database/schemas/User.schema.ts
forty-sql migration:add <migration-name> [--add | -a]
forty-sql migration:add <migration-name> [--update | -u]
forty-sql migration:add <migration-name> [--remove | -r]
forty-sql migration:add <migration-name> <action> [--table | -t] <table-name>
forty-sql migration:add AddFullNameColumn --add --table users
Create a remove
command for Migrations
down
method from the last created migration and remove it.Create a migration history table to track migrations similar to EF Core to prevent unwanted side-effects
FAQs
CLI for @forty-boy/sql
The npm package @forty-boy/sql-cli receives a total of 0 weekly downloads. As such, @forty-boy/sql-cli popularity was classified as not popular.
We found that @forty-boy/sql-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.