-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
1,455 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,192 @@ | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
on: [push] | ||
name: "test" | ||
jobs: | ||
build: | ||
name: Testing on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
- os: windows-2022 | ||
- os: macos-latest | ||
build-linux_x86-extension: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Build + Test | ||
run: | | ||
mkdir -p dist/ | ||
make loadable | ||
make test-loadable | ||
- run: make loadable | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: sqlite-path-linux_x86 | ||
path: dist/path0.so | ||
|
||
build-linux_x86-python: | ||
runs-on: ubuntu-20.04 | ||
needs: [build-linux_x86-extension] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Download workflow artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: sqlite-path-linux_x86 | ||
path: dist/ | ||
- uses: actions/setup-python@v3 | ||
- run: pip install wheel | ||
- run: make python | ||
- run: make datasette | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: sqlite-path-linux_x86-wheels | ||
path: dist/wheels/*.whl | ||
test-linux_x86: | ||
runs-on: ubuntu-20.04 | ||
needs: [build-linux_x86-extension, build-linux_x86-python] | ||
env: | ||
DENO_DIR: deno_cache | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: sqlite-path-linux_x86 | ||
path: dist/ | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: sqlite-path-linux_x86-wheels | ||
path: dist/ | ||
- run: cp dist/path0.so npm/sqlite-path-linux-x64/lib | ||
- run: pip3 install --find-links dist/ sqlite_path | ||
- run: make test-loadable | ||
- run: make test-python | ||
# for test-npm | ||
- uses: actions/setup-node@v3 | ||
with: | ||
cache: "npm" | ||
cache-dependency-path: npm/sqlite-path/package.json | ||
- run: npm install | ||
working-directory: npm/sqlite-path | ||
- run: make test-npm | ||
# for test-deno | ||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.30 | ||
- name: Cache Deno dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.DENO_DIR }} | ||
key: ${{ runner.os }}-${{ hashFiles('deno/deno.lock') }} | ||
- run: make test-deno | ||
env: | ||
DENO_SQLITE_PATH_PATH: ${{ github.workspace }}/dist/path0 | ||
build-macos-extension: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- run: make loadable | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: sqlite-path-macos | ||
path: dist/path0.dylib | ||
build-macos-python: | ||
runs-on: macos-latest | ||
needs: [build-macos-extension] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Download workflow artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: sqlite-path-macos | ||
path: dist/ | ||
- uses: actions/setup-python@v3 | ||
- run: pip install wheel | ||
- run: make python | ||
- run: make datasette | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: sqlite-path-macos-wheels | ||
path: dist/wheels/*.whl | ||
test-macos: | ||
runs-on: macos-latest | ||
needs: [build-macos-extension, build-macos-python] | ||
env: | ||
DENO_DIR: deno_cache | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: sqlite-path-macos | ||
path: dist/ | ||
- run: cp dist/path0.dylib npm/sqlite-path-darwin-x64/lib | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: sqlite-path-macos-wheels | ||
path: dist/ | ||
- run: brew install python | ||
- run: /usr/local/opt/python@3/libexec/bin/pip install --find-links dist/ sqlite_path | ||
- run: make test-loadable python=/usr/local/opt/python@3/libexec/bin/python | ||
- run: make test-python python=/usr/local/opt/python@3/libexec/bin/python | ||
# for test-npm | ||
- uses: actions/setup-node@v3 | ||
with: | ||
cache: "npm" | ||
cache-dependency-path: npm/sqlite-path/package.json | ||
- run: npm install | ||
working-directory: npm/sqlite-path | ||
- run: make test-npm | ||
# for test-deno | ||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.30 | ||
- name: Cache Deno dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.DENO_DIR }} | ||
key: ${{ runner.os }}-${{ hashFiles('deno/deno.lock') }} | ||
- run: make test-deno | ||
env: | ||
DENO_SQLITE_PATH_PATH: ${{ github.workspace }}/dist/path0.dylib | ||
build-windows-extension: | ||
name: Building windows extension | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- run: make loadable | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: sqlite-path-windows | ||
path: dist/path0.dll | ||
build-windows-python: | ||
runs-on: windows-latest | ||
needs: [build-windows-extension] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Download workflow artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: sqlite-path-windows | ||
path: dist/ | ||
- uses: actions/setup-python@v3 | ||
- run: pip install wheel | ||
- run: make python | ||
- run: make datasette | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: sqlite-path-windows-wheels | ||
path: dist/wheels/*.whl | ||
test-windows: | ||
runs-on: windows-2022 | ||
needs: [build-windows-extension, build-windows-python] | ||
env: | ||
DENO_DIR: deno_cache | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: sqlite-path-windows | ||
path: dist/ | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: sqlite-path-windows | ||
path: npm/sqlite-path-windows-x64/lib | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: sqlite-path-windows-wheels | ||
path: dist/ | ||
- run: pip install --find-links dist/ sqlite_path | ||
- run: make test-loadable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
a.out | ||
dist/ | ||
bench/ | ||
*.dylib | ||
*.so | ||
*.dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v0.1.0 | ||
0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!--- Generated with the deno_generate_package.sh script, don't edit by hand! --> | ||
|
||
# `x/sqlite_path` Deno Module | ||
|
||
[![Tags](https://img.shields.io/github/release/asg017/sqlite-path)](https://github.com/asg017/sqlite-path/releases) | ||
[![Doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/sqlite-path@0.1.0/mod.ts) | ||
|
||
The [`sqlite-path`](https://github.com/asg017/sqlite-path) SQLite extension is available to Deno developers with the [`x/sqlite_path`](https://deno.land/x/sqlite-path) Deno module. It works with [`x/sqlite3`](https://deno.land/x/sqlite3), the fastest and native Deno SQLite3 module. | ||
|
||
```js | ||
import { Database } from "https://deno.land/x/sqlite3@0.8.0/mod.ts"; | ||
import * as sqlite_path from "https://deno.land/x/sqlite_path@v0.1.0/mod.ts"; | ||
|
||
const db = new Database(":memory:"); | ||
|
||
db.enableLoadExtension = true; | ||
db.loadExtension(sqlite_path.getLoadablePath()); | ||
|
||
const [version] = db | ||
.prepare("select path_version()") | ||
.value<[string]>()!; | ||
|
||
console.log(version); | ||
|
||
``` | ||
|
||
Like `x/sqlite3`, `x/sqlite_path` requires network and filesystem permissions to download and cache the pre-compiled SQLite extension for your machine. Though `x/sqlite3` already requires `--allow-ffi` and `--unstable`, so you might as well use `--allow-all`/`-A`. | ||
|
||
```bash | ||
deno run -A --unstable <file> | ||
``` | ||
|
||
`x/sqlite_path` does not work with [`x/sqlite`](https://deno.land/x/sqlite@v3.7.0), which is a WASM-based Deno SQLite module that does not support loading extensions. |
Oops, something went wrong.