@sqlike/cli 0.4.5 → 0.4.6

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.
Files changed (2) hide show
  1. package/README.md +12 -13
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -4,9 +4,9 @@ Command-line client for [sqlike](https://sqlike.com), a deterministic SQL static
4
4
  advisor (validity, anti-patterns, rewrites, index and schema advice) and query-equivalence checker
5
5
  for Postgres, MySQL, MariaDB, SQLite, SQL Server, and DuckDB.
6
6
 
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.
7
+ This package is a remote client. It tokenizes your SQL on your machine, which replaces identifiers
8
+ and literals with placeholders, and sends only the tokenized query to the sqlike API. There is no
9
+ analysis engine in it.
10
10
 
11
11
  ## Use it
12
12
 
@@ -22,30 +22,29 @@ brew install orifisher2/sqlike/sqlike
22
22
  echo 'SELECT * FROM users WHERE id IN (SELECT uid FROM bans)' \
23
23
  | sqlike check - --json
24
24
 
25
- # check a rewrite is equivalent (equivalence always runs server-side)
25
+ # check that a rewrite is equivalent
26
26
  sqlike diff before.sql after.sql --schema schema.sql
27
27
  ```
28
28
 
29
29
  Pass `--dialect postgres|mysql|mariadb|sqlite|mssql|duckdb` (default postgres), `--schema <ddl-file>` for
30
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
+ `EXPLAIN` output, pass it with `--explain <file>`: index findings are then confirmed or dismissed by
32
+ what the planner did. The schema and the plan are tokenized too.
33
33
 
34
- Exit codes are a contract: `0` clean or equivalent, `1` advisory or differs, `2` blocking issue or
35
- undecided, `3` operational error.
34
+ Exit codes: `0` clean or equivalent, `1` a warning (with `--fail-on warn`) or differs, `2` a
35
+ blocking finding or undecided, `3` the check could not run, `4` usage error.
36
36
 
37
37
  ### Privacy
38
38
 
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` to
41
- override that for a parse diagnostic.
39
+ A query is tokenized before it leaves your machine. A query that does not parse is reported on
40
+ your machine and nothing is sent. A query that holds text the tokenizer cannot replace, such as a
41
+ password in `ALTER USER`, is not sent unless you pass `--allow-raw`.
42
42
 
43
43
  ## How it ships
44
44
 
45
45
  The CLI is a native binary. Each platform's binary is published as its own optional-dependency
46
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.
47
+ one matching your OS and CPU. No install scripts run, so it works with `--ignore-scripts`. Supported: linux x64 and arm64, macOS x64 and arm64, Windows x64.
49
48
 
50
49
  ## License
51
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sqlike/cli",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Lints SQL and checks that a rewrite still returns the same rows. Postgres, MySQL, MariaDB, SQLite, SQL Server and DuckDB. Queries are tokenized before they leave your machine.",
5
5
  "keywords": [
6
6
  "sql",
@@ -33,10 +33,10 @@
33
33
  "node": ">=18"
34
34
  },
35
35
  "optionalDependencies": {
36
- "@sqlike/cli-darwin-arm64": "0.4.5",
37
- "@sqlike/cli-darwin-x64": "0.4.5",
38
- "@sqlike/cli-linux-arm64": "0.4.5",
39
- "@sqlike/cli-linux-x64": "0.4.5",
40
- "@sqlike/cli-win32-x64": "0.4.5"
36
+ "@sqlike/cli-darwin-arm64": "0.4.6",
37
+ "@sqlike/cli-darwin-x64": "0.4.6",
38
+ "@sqlike/cli-linux-arm64": "0.4.6",
39
+ "@sqlike/cli-linux-x64": "0.4.6",
40
+ "@sqlike/cli-win32-x64": "0.4.6"
41
41
  }
42
42
  }