Gathering detailed insights and metrics for @fxjs/sql-ddl-sync
Gathering detailed insights and metrics for @fxjs/sql-ddl-sync
npm install @fxjs/sql-ddl-sync
Typescript
Module System
Node Version
NPM Version
JavaScript (56.96%)
TypeScript (43.04%)
Total Downloads
41,673
Last Day
4
Last Week
24
Last Month
128
Last Year
2,109
3 Stars
567 Commits
5 Forks
7 Watching
17 Branches
7 Contributors
Minified
Minified + Gzipped
Latest Version
0.11.6
Package Id
@fxjs/sql-ddl-sync@0.11.6
Unpacked Size
106.89 kB
Size
17.78 kB
File Count
29
NPM Version
lerna/8.1.2/node@v18.18.2+x64 (win32)
Node Version
18.18.2
Publised On
16 May 2024
Cumulative downloads
Total Downloads
Last day
100%
4
Compared to previous day
Last week
71.4%
24
Compared to previous week
Last month
184.4%
128
Compared to previous month
Last year
-50.4%
2,109
Compared to previous year
3
2
NOTICE: This is node-sql-ddl-sync's fibjs version, thx a lot to node-sql-ddl-sync's author : )
1npm install @fxjs/sql-ddl-sync
Originally, this module is part of @fxjs/orm. It's used synchronize model tables in supported dialects.
But now, it could run without @fxjs/orm, just install @fxjs/db-driver instead 🚀 Sorry there is no API documentation for now but there are a couple of tests you can read and find out how to use it if you want.
Version Match
sql-ddl-sync Version | required orm Version |
---|---|
sql-ddl-sync <= 0.3.x | orm < 1.10.3 |
sql-ddl-sync = 0.4.x | orm >= 1.10.3 |
sql-ddl-sync >= 0.5.x | don't need! |
Install @fxjs/db-driver. Create a file with the contents below and change insert your database credentials.
Run once and you'll see table ddl_sync_test
appear in your database. Then make some changes to it (add/drop/change columns)
and run the code again. Your table should always return to the same structure.
1const DBDriver = require("@fxjs/db-driver"); 2const mysql = require("mysql"); 3const Sync = require("@fxjs/sql-ddl-sync").Sync; 4 5const dbdriver = DBDriver.create("mysql://username:password@localhost/database"); 6 7const sync = new Sync({ 8 dbdriver: dbdriver, 9 debug : function (text) { 10 console.log("> %s", text); 11 } 12}); 13 14sync.defineCollection("ddl_sync_test", { 15 id : { type: "serial", key: true, serial: true }, 16 name : { type: "text", required: true }, 17 age : { type: "integer" }, 18 male : { type: "boolean" }, 19 born : { type: "date", time: true }, 20 born2 : { type: "date" }, 21 int2 : { type: "integer", size: 2 }, 22 int4 : { type: "integer", size: 4 }, 23 int8 : { type: "integer", size: 8 }, 24 float4 : { type: "number", size: 4 }, 25 float8 : { type: "number", size: 8 }, 26 photo : { type: "binary" } 27}); 28 29try { 30 sync.sync() 31 console.log("> Sync Done"); 32} catch (err) { 33 if (err) { 34 console.log("> Sync Error"); 35 console.log(err); 36 } 37} 38 39process.exit(0);
To test, first make sure you have development dependencies installed. Go to the root folder and do:
1npm install
Then, just run the tests.
1npm test
If you have a supported database server and want to test against it, first install the module:
And then run:
1URI=mysql://username:password@localhost/database fibjs test/run-db
This repo is checked out from Diogo Resende's node-sql-ddl-sync, which is one part of orm
, and orm is the original source of @fxjs/orm
. Thx a lot to him and his partner.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 4/30 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More