Skip to content

Commit

Permalink
Merge 'Add clippy CI, fix or ignore warnings where appropriate' from …
Browse files Browse the repository at this point in the history
…Preston Thorpe

There is no semantic changes in this PR, the clippy command came from
@pereman2's suggestion in #542
There was more to fix than I previously thought. I originally set out to
refactor out some of the logic in `vdbe::step`, but with some actual
semantic changes. That file: `vdbe/mod.rs` is so full that it required
moving the `Insn` enum to another file, so I figured I would just put
some non-semantic changes all together so it's easier to review and get
that done first... and figured I'd fix some clippy warnings while I was
at it. Also adjusted the actions to `checkout/@v3`.
The project is obviously so early that there are going to be a decent
amount of things like unused fields or methods, which is why I was
originally not really pro clippy.. but seeing how many genuinely good
improvements it recommended, I think it's probably the right way to go.

Closes #563
  • Loading branch information
pereman2 committed Dec 29, 2024
2 parents d6ba34d + 361e55f commit b9187d5
Show file tree
Hide file tree
Showing 91 changed files with 9,168 additions and 2,586 deletions.
37 changes: 23 additions & 14 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
cargo-fmt-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check formatting
run: cargo fmt --check

Expand All @@ -27,6 +27,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Build
run: cargo build --verbose
- name: Test
Expand All @@ -35,46 +39,51 @@ jobs:
run: cargo test --verbose
timeout-minutes: 5


clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Clippy
run: |
cargo clippy -- -A clippy::all -W clippy::correctness -W clippy::perf -W clippy::suspicious --deny=warnings
build-wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- run: wasm-pack build --target nodejs bindings/wasm

bench:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Bench
run: cargo bench

test-limbo:
runs-on: ubuntu-latest
steps:
- name: Install sqlite
run: sudo apt update && sudo apt install -y sqlite3 libsqlite3-dev
- name: Install cargo-c
env:
LINK: https://github.com/lu-zero/cargo-c/releases/download/v0.10.7
CARGO_C_FILE: cargo-c-x86_64-unknown-linux-musl.tar.gz
run: |
curl -L $LINK/$CARGO_C_FILE | tar xz -C ~/.cargo/bin
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Test
run: make test

test-sqlite:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install
run: |
set -euo pipefail
mkdir download && cd download
# apt contains an old version of sqlite3 that does not support e.g. string_agg(), so we download 3.46.0 manually
wget https://www.sqlite.org/2024/sqlite-tools-linux-x64-3460000.zip
unzip sqlite-tools-linux-x64-3460000.zip
- uses: actions/checkout@v3
- name: Install sqlite
run: sudo apt update && sudo apt install -y sqlite3 libsqlite3-dev
- name: Test
run: SQLITE_EXEC="$(pwd)/download/sqlite3" make test-compat
run: SQLITE_EXEC="sqlite3" make test-compat
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## Unreleased
## 0.0.10 - 2024-12-18

### Added

Expand Down
64 changes: 58 additions & 6 deletions COMPAT.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ Feature support of [sqlite expr syntax](https://www.sqlite.org/lang_expr.html).
| instr(X,Y) | Yes | |
| last_insert_rowid() | Yes | |
| length(X) | Yes | |
| like(X,Y) | No | |
| like(X,Y,Z) | No | |
| like(X,Y) | Yes | |
| like(X,Y,Z) | Yes | |
| likelihood(X,Y) | No | |
| likely(X) | No | |
| load_extension(X) | No | |
Expand Down Expand Up @@ -160,6 +160,45 @@ Feature support of [sqlite expr syntax](https://www.sqlite.org/lang_expr.html).
| upper(X) | Yes | |
| zeroblob(N) | Yes | |





### Mathematical functions

| Function | Status | Comment |
| ---------- | ------ | ------- |
| acos(X) | Yes | |
| acosh(X) | Yes | |
| asin(X) | Yes | |
| asinh(X) | Yes | |
| atan(X) | Yes | |
| atan2(Y,X) | Yes | |
| atanh(X) | Yes | |
| ceil(X) | Yes | |
| ceiling(X) | Yes | |
| cos(X) | Yes | |
| cosh(X) | Yes | |
| degrees(X) | Yes | |
| exp(X) | Yes | |
| floor(X) | Yes | |
| ln(X) | Yes | |
| log(B,X) | Yes | |
| log(X) | Yes | |
| log10(X) | Yes | |
| log2(X) | Yes | |
| mod(X,Y) | Yes | |
| pi() | Yes | |
| pow(X,Y) | Yes | |
| power(X,Y) | Yes | |
| radians(X) | Yes | |
| sin(X) | Yes | |
| sinh(X) | Yes | |
| sqrt(X) | Yes | |
| tan(X) | Yes | |
| tanh(X) | Yes | |
| trunc(X) | Yes | |

### Aggregate functions

| Function | Status | Comment |
Expand Down Expand Up @@ -193,10 +232,10 @@ Feature support of [sqlite expr syntax](https://www.sqlite.org/lang_expr.html).
|------------------------------------|---------|---------|
| json(json) | Partial | |
| jsonb(json) | | |
| json_array(value1,value2,...) | | |
| json_array(value1,value2,...) | Yes | |
| jsonb_array(value1,value2,...) | | |
| json_array_length(json) | | |
| json_array_length(json,path) | | |
| json_array_length(json) | Yes | |
| json_array_length(json,path) | Yes | |
| json_error_position(json) | | |
| json_extract(json,path,...) | | |
| jsonb_extract(json,path,...) | | |
Expand Down Expand Up @@ -356,7 +395,7 @@ Feature support of [sqlite expr syntax](https://www.sqlite.org/lang_expr.html).
| ReadCookie | No |
| Real | Yes |
| RealAffinity | Yes |
| Remainder | No |
| Remainder | Yes |
| ResetCount | No |
| ResultRow | Yes |
| Return | Yes |
Expand Down Expand Up @@ -414,3 +453,16 @@ Feature support of [sqlite expr syntax](https://www.sqlite.org/lang_expr.html).
| Variable | No |
| VerifyCookie | No |
| Yield | Yes |




| LibSql Compatibility / Extensions| | |
| ---------------------------- | ------ | ------- |
| **UUID** | | UUID's in limbo are `blobs` by default|
| uuid4() | Yes | uuid version 4 |
| uuid4_str() | Yes | uuid v4 string alias `gen_random_uuid()` for PG compatibility|
| uuid7(X?) | Yes | uuid version 7, Optional arg for seconds since epoch|
| uuid7_timestamp_ms(X) | Yes | Convert a uuid v7 to milliseconds since epoch|
| uuid_str(X) | Yes | Convert a valid uuid to string|
| uuid_blob(X) | Yes | Convert a valid uuid to blob|
30 changes: 21 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ members = [
"sqlite3",
"core",
"simulator",
"test",
"test", "macros",
]
exclude = ["perf/latency/limbo"]

[workspace.package]
version = "0.0.9"
version = "0.0.10"
authors = ["the Limbo authors"]
edition = "2021"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ test: limbo test-compat test-sqlite3 test-shell
.PHONY: test

test-shell: limbo
./testing/shelltests.py
SQLITE_EXEC=$(SQLITE_EXEC) ./testing/shelltests.py
.PHONY: test-shell

test-compat:
Expand Down
23 changes: 23 additions & 0 deletions PERF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Performance Testing

## Mobibench

1. Clone the source repository of Mobibench fork for Limbo:

```console
git clone [email protected]:penberg/Mobibench.git
```

2. Change `LIBS` in `shell/Makefile` to point to your Limbo source repository.

3. Build Mobibench:

```console
cd shell && make
```

4. Run Mobibench:

```console
./mobibench -p <benchmark-directory> -n 1000 -d 0
```
9 changes: 8 additions & 1 deletion bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ dependencies = ['typing-extensions >=4.6.0,!=4.7.0']
dynamic = ['readme', 'version']

[project.optional-dependencies]
dev = ["mypy==1.11.0", "pytest==8.3.1", "pytest-cov==5.0.0", "ruff==0.5.4", "coverage==7.6.1"]
dev = [
"mypy==1.11.0",
"pytest==8.3.1",
"pytest-cov==5.0.0",
"ruff==0.5.4",
"coverage==7.6.1",
"maturin==1.7.8",
]

[project.urls]
Homepage = "https://github.com/penberg/limbo"
Expand Down
Loading

0 comments on commit b9187d5

Please sign in to comment.