Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ A real `BOOLEAN` type for VillageSQL. Replaces `BOOL`/`BOOLEAN` aliases for
`TINYINT(1)` with a proper boolean type — clear metadata, standard truth
values, and correct dump/restore semantics.

## Installation

If you installed VillageSQL with the install script, the Docker image, or a
release tarball, `vsql_boolean.veb` is already in the server's `lib/veb/`
directory — this extension is bundled with the server. There is nothing to build
or download:

```sql
INSTALL EXTENSION vsql_boolean;
```

Build from source only if you built the server from source without the bundled
extensions, or if you are working on this extension itself.

## Building

**Linux:**
Expand All @@ -17,7 +31,7 @@ cmake --install build
**macOS:**
```bash
mkdir -p build
cmake -S . -B build -DVillageSQL_BUILD_DIR=~/.villagesql/build
cmake -S . -B build -DVillageSQL_BUILD_DIR="$HOME/.villagesql/build"
cmake --build build
cmake --install build
```
Expand Down Expand Up @@ -70,6 +84,11 @@ Storage: 1 byte on disk (`0x00` = FALSE, `0x01` = TRUE).
| `'false'`, `'f'`, `'no'`, `'off'`, `'0'` | FALSE |
| `NULL` | NULL |

Only the quoted string forms above are accepted. A bare numeric literal is
rejected — `INSERT INTO settings VALUES (1, 1)` raises
`ERROR 3219: Incorrect STRICTBOOL value: '1'` — unlike `TINYINT(1)`, which
coerces it silently.

**Output**: `'true'` or `'false'` (lowercase).

**Ordering**: `FALSE` sorts before `TRUE`; NULLs first with `ASC`.
Expand Down Expand Up @@ -101,8 +120,10 @@ https://github.com/villagesql/villagesql-server/issues/264.

**Uninstalling requires no dependent columns.** `UNINSTALL EXTENSION
vsql_boolean` fails if any table has a `STRICTBOOL` column. Drop or alter
those columns first, then uninstall, then reinstall. There is no
`ALTER EXTENSION` command. Track upgrade support at
those columns first, then uninstall, then reinstall. A version change can also
be staged with `ALTER EXTENSION vsql_boolean VERSION '<v>' AT RESTART`, which
takes effect at the next server restart rather than immediately. Track upgrade
support at
https://github.com/villagesql/villagesql-server/issues/12.

## Testing
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ set -euo pipefail

mkdir -p build
cmake -S . -B build -DVillageSQL_BUILD_DIR="$VillageSQL_BUILD_DIR"
cmake --build build -- -j "$(( $(getconf _NPROCESSORS_ONLN) - 2 ))"
cmake --build build -- -j "$(getconf _NPROCESSORS_ONLN)"
cmake --install build
Loading