Update README.md to include local installation instructions
Some checks failed
Build / test-action (push) Has been cancelled
Build / build (push) Has been cancelled

This commit is contained in:
Alessio 2025-04-19 18:28:07 -07:00
parent 58f786dd71
commit 81b801237f

View File

@ -2,6 +2,8 @@
This GitHub Action lints SQLite schema files to enforce various constraints. It is designed to ensure that your SQLite schemas adhere to best practices.
You can also install it to validate schemas locally.
## Inputs
- **`schema-file`**: (Required) The SQL schema file to lint.
@ -25,6 +27,16 @@ jobs:
schema-file: pkg/db/schema.sql
```
## Installing
CGo is required. You will need a C compiler (and if it isn't `gcc` you might have to specify what it is as `CC=whatever` before installing).
```bash
CGO_ENABLED=1 go install github.com/playfulpachyderm/sqlite-lint/cmd/sqlite_lint@v1.0.2
sqlite_lint <path/to/schema.sql>
```
## Available Checks
All checks are enabled by default. To turn one off, you can use:
@ -37,6 +49,12 @@ All checks are enabled by default. To turn one off, you can use:
This will disable the `require_not_null` check.
When running locally, you can use:
```bash
INPUT_REQUIRE_NOT_NULL=false sqlite_lint <path/to/schema.sql> # `require_not_null` check will be skipped
```
### `require_not_null`
Enforce that all columns should be marked as `not null` unless they are foreign keys.