@sqlike/cli 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -17
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# @sqlike/cli
|
|
2
2
|
|
|
3
|
-
Command-line client for [sqlike](https://sqlike.com)
|
|
4
|
-
advisor (validity, anti-patterns, rewrites, schema advice) and query-equivalence checker
|
|
5
|
-
Postgres, MySQL, SQLite, and SQL Server.
|
|
3
|
+
Command-line client for [sqlike](https://sqlike.com), a deterministic SQL static analyzer and
|
|
4
|
+
advisor (validity, anti-patterns, rewrites, index and schema advice) and query-equivalence checker
|
|
5
|
+
for Postgres, MySQL, MariaDB, SQLite, and SQL Server.
|
|
6
6
|
|
|
7
|
-
This package is a **thin remote client
|
|
8
|
-
are
|
|
9
|
-
API.
|
|
7
|
+
This package is a **thin remote client**. It tokenizes your SQL locally, so identifiers and literals
|
|
8
|
+
are masked before anything leaves your machine, and forwards only the tokenized query to the sqlike
|
|
9
|
+
API. There is no analysis engine in it.
|
|
10
10
|
|
|
11
11
|
## Use it
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ npx @sqlike/cli check query.sql --remote https://api.sqlike.com
|
|
|
16
16
|
|
|
17
17
|
# or install it
|
|
18
18
|
npm i -g @sqlike/cli
|
|
19
|
-
|
|
19
|
+
brew install orifisher2/sqlike/sqlike
|
|
20
20
|
|
|
21
21
|
# from stdin, machine-readable
|
|
22
22
|
echo 'SELECT * FROM users WHERE id IN (SELECT uid FROM bans)' \
|
|
@@ -26,25 +26,26 @@ echo 'SELECT * FROM users WHERE id IN (SELECT uid FROM bans)' \
|
|
|
26
26
|
sqlike diff before.sql after.sql --schema schema.sql
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
Pass `--dialect postgres|mysql|sqlite|mssql` (default postgres), `--schema <ddl-file>` for
|
|
30
|
-
column
|
|
29
|
+
Pass `--dialect postgres|mysql|mariadb|sqlite|mssql` (default postgres), `--schema <ddl-file>` for
|
|
30
|
+
column and type aware checks, and `--key <api-key>` for higher rate limits. If you have the query's
|
|
31
|
+
`EXPLAIN` output, `--explain <file>` lets the real access paths confirm or dismiss the index
|
|
32
|
+
findings. The schema and the plan are tokenized too.
|
|
31
33
|
|
|
32
|
-
Exit codes are a contract: `0` clean
|
|
34
|
+
Exit codes are a contract: `0` clean or equivalent, `1` advisory or differs, `2` blocking issue or
|
|
33
35
|
undecided, `3` operational error.
|
|
34
36
|
|
|
35
37
|
### Privacy
|
|
36
38
|
|
|
37
|
-
A query is tokenized before it leaves your machine.
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
A query is tokenized before it leaves your machine. One that cannot be parsed cannot be tokenized,
|
|
40
|
+
so `check` and `diff` refuse rather than send raw SQL. Pass `--allow-raw` (with `--remote`) to
|
|
41
|
+
override that for a parse diagnostic.
|
|
40
42
|
|
|
41
43
|
## How it ships
|
|
42
44
|
|
|
43
45
|
The CLI is a native binary. Each platform's binary is published as its own optional-dependency
|
|
44
|
-
package (`@sqlike/cli-linux-x64`, `@sqlike/cli-darwin-arm64`,
|
|
45
|
-
your OS and CPU. No install scripts run
|
|
46
|
-
environments. Supported: linux x64
|
|
47
|
-
(`brew install orifisher2/sqlike/sqlike`).
|
|
46
|
+
package (`@sqlike/cli-linux-x64`, `@sqlike/cli-darwin-arm64`, and so on), so npm installs only the
|
|
47
|
+
one matching your OS and CPU. No install scripts run, which means this works with `--ignore-scripts`
|
|
48
|
+
and in locked-down environments. Supported: linux x64 and arm64, macOS x64 and arm64, Windows x64.
|
|
48
49
|
|
|
49
50
|
## License
|
|
50
51
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqlike/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "CLI for sqlike — deterministic SQL static analysis and query-equivalence checking. A thin remote client that tokenizes locally and forwards to the sqlike API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sql",
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
"postgres",
|
|
12
12
|
"mysql",
|
|
13
13
|
"sqlite",
|
|
14
|
-
"sqlserver"
|
|
14
|
+
"sqlserver",
|
|
15
|
+
"mariadb",
|
|
16
|
+
"duckdb"
|
|
15
17
|
],
|
|
16
18
|
"homepage": "https://sqlike.com",
|
|
17
19
|
"repository": {
|
|
@@ -30,10 +32,10 @@
|
|
|
30
32
|
"node": ">=18"
|
|
31
33
|
},
|
|
32
34
|
"optionalDependencies": {
|
|
33
|
-
"@sqlike/cli-darwin-arm64": "0.
|
|
34
|
-
"@sqlike/cli-darwin-x64": "0.
|
|
35
|
-
"@sqlike/cli-linux-arm64": "0.
|
|
36
|
-
"@sqlike/cli-linux-x64": "0.
|
|
37
|
-
"@sqlike/cli-win32-x64": "0.
|
|
35
|
+
"@sqlike/cli-darwin-arm64": "0.2.0",
|
|
36
|
+
"@sqlike/cli-darwin-x64": "0.2.0",
|
|
37
|
+
"@sqlike/cli-linux-arm64": "0.2.0",
|
|
38
|
+
"@sqlike/cli-linux-x64": "0.2.0",
|
|
39
|
+
"@sqlike/cli-win32-x64": "0.2.0"
|
|
38
40
|
}
|
|
39
41
|
}
|