File tree Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Original file line number Diff line number Diff line change 1+ This is a wasm-compiled version of [ sqldef] ( https://github.com/sqldef/sqldef ) for easy use in JS.
2+
3+ ## usage
4+
5+ ### node/bun/etc
6+
7+ ``` bash
8+ npm i sqldef
9+ ```
10+
11+ ``` js
12+ import sqldef from sqldef
13+
14+ const output = await (sqldef ({
15+ type, // the type of your database ("mysql" or "postgres")
16+ database, // the name of your database
17+ user, // the username of your database
18+ password, // the password of your database
19+ host, // the hostname of your database
20+ port, // the port of your database
21+ socket, // the unix socket (for mysql)
22+ file, // the schema file to read/write
23+ dry: true , // dry run - don't do anything to the database
24+ get: true // get the current definition from database
25+ }))
26+ ```
27+
28+ _ TODO_ : notes about web
29+
30+ ### development
31+
32+ Normally, you should not need to do this stuff, but for local dev:
33+
34+ ``` bash
35+ # start a watching local web-server
36+ # /sqldef is aliases to root-dir
37+ npm start
38+
39+ # run all unit-tests
40+ npm t
41+ ```
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 88 " mysql" ,
99 " postgres"
1010 ],
11- "main" : " index.cjs" ,
1211 "exports" : {
1312 "." : " ./index.js"
1413 },
1514 "scripts" : {
1615 "test" : " node --test" ,
17- "start" : " npx -y live-server docs"
16+ "start" : " npx -y live-server docs -mount= "
1817 },
1918 "author" :
" David Konsumer <[email protected] > (http://konsumer.js.org)" ,
2019 "license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments