Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@bodar/terra-ratchet-big-query
Advanced tools
Migrate your environments with real code today!
If the answer to any of those question is yes then TerraRatchet may be what you have been waiting for.
If you have used a DB migration tool recently you probably already know how to use TerraRatchet, you have a folder with a bunch of scripts that need to be run once in a certain order (these are normally checked in):
scripts
001-deploy-postgres.sh
002-create-database.postgres.sql
003-create-bigquery-dataset.sh
004-add-permissions-to-dataset.sh
005-import-table.bigquery.sql
006-create-redis-server.sh
007-create-timeseries.redis
You have a DB or file server than can store which scripts have been run, normally part of the environment you are deploying.
Now just add TerraRatchet to your build.
import { File } from '@bodar/totallylazy/files';
import { TerraRatchet, FileRunnableScripts, NoOpScriptRunner, ShellScriptRunner } from '@bodar/terra-ratchet';
import { BigQueryExecutedScripts, BigQueryScriptRunner } from '@bodar/terra-ratchet-big-query';
const projectId = process.env.GOOGLE_CLOUD_PROJECT;
const datasetId = process.env.CI === 'true' ? 'production' : 'development';
const tableId = 'ratchet-table-id';
(async () => {
const env = { ...process.env, projectId, datasetId };
const executedScripts = new BigQueryExecutedScripts(projectId, datasetId, tableId);
await executedScripts.setup();
const scripts = new File('scripts', __dirname);
await new TerraRatchet(new FileRunnableScripts(scripts), executedScripts)
.ignore('d.ts', 'js', 'map') // ignore generated code
.register('006-create-redis-server.sh', new NoOpScriptRunner()) // skip manually ran script
.register('sql', new BigQueryScriptRunner(scripts, projectId, datasetId))
.register('sh', new ShellScriptRunner(scripts, env))
.run();
})();
TerraRatchet is made up of a couple of different parts:
RunnableScripts | Status | Description |
---|---|---|
InMemoryRunnableScripts | Released | Can be used for testing |
FileRunnableScripts | Released | Point to a folder |
ExecutedScripts | Status | Description |
---|---|---|
InMemoryExecutedScripts | Released | Can be used for testing |
FileExecutedScripts | Released | Records which scripts have been run in a json file |
BigQueryExecutedScripts | Released | Records which scripts have been run in a BigQuery table |
PostgresExecutedScripts | Planned | Records which scripts have been run in a Postgres table |
It's worth remember than any command can be run if it has a command line, the SQL runners are just convenient
ScriptRunner | Status | Description |
---|---|---|
NoOpScriptRunner | Released | Does nothing. Can be used to ignore a manually run script |
ShellScriptRunner | Released | Used to run a shell command (anything, no plugins required) |
BigQueryScriptRunner | Released | Used to run BigQuery SQL statements |
PostgresScriptRunner | Planned | Used to run Postgres SQL statements |
FAQs
Unknown package
The npm package @bodar/terra-ratchet-big-query receives a total of 5 weekly downloads. As such, @bodar/terra-ratchet-big-query popularity was classified as not popular.
We found that @bodar/terra-ratchet-big-query demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.