Skip to content

Commit 2ef5eee

Browse files
committed
add README
1 parent e65aaf5 commit 2ef5eee

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
```

index.cjs

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
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",

0 commit comments

Comments
 (0)