Skip to content

Commit

Permalink
chore: add required SQLite extensions to support
Browse files Browse the repository at this point in the history
  • Loading branch information
shah committed Oct 20, 2023
1 parent ded3c44 commit a9419a0
Show file tree
Hide file tree
Showing 17 changed files with 323 additions and 2 deletions.
3 changes: 2 additions & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"ts-check": "deno check --no-lock --unstable $(find . -name '*.ts' -not -path \"./support/*\")",
"prepare-publish": "git semtag final",
"prepare-npm": "deno run -A support/package-npm/build-npm.ts",
"publish-npm": "cd support/package-npm && npm publish"
"publish-npm": "cd support/package-npm && npm publish",
"sync-sqlpkg": "rsync -av --delete ~/.sqlpkg/ ./support/bin/sqlpkg/"
}
}
5 changes: 4 additions & 1 deletion pattern/fs-content/mod_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { testingAsserts as ta } from "../../deps-test.ts";
import { path } from "../../deps.ts";
import * as ft from "../../lib/universal/flexible-text.ts";
import * as sh from "../../lib/sqlite/shell.ts";
import * as SQLa from "../../render/mod.ts";
Expand Down Expand Up @@ -42,7 +43,9 @@ export const sqlPkgExtnLoadSqlSupplier = (
): SQLa.SqlTextBehaviorSupplier<Any> => {
const sqlPkgHome = Deno.env.has("SQLPKG_HOME")
? Deno.env.get("SQLPKG_HOME")
: `${Deno.env.get("HOME")}/.sqlpkg`;
: path.fromFileUrl(
import.meta.resolve(`../../support/bin/sqlpkg`),
);
return {
executeSqlBehavior: () => {
return {
Expand Down
41 changes: 41 additions & 0 deletions support/bin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# SQL Aide Supporting Binaries

## `doctor.ts`

Used by deno.jsonc to see which dependencies might be missing.

## SQLite Extensions Package

We use [sqlpkg-cli](https://github.com/nalgeon/sqlpkg-cli) to download and
manage all the SQLite extensions we need for our examples and patterns that
depend SQLite. SQLa core SQL generator does not require SQLite or any database
but some patterns and examples (like `pattern/fs-content`) do require SQLite and
some third-party extensions.

## Sourcing the files

First get the `sqlpkg-cli` binary:

```bash
$ eget nalgeon/sqlpkg-cli --file="sqlpkg"
```

Now get all the extensions

```bash
$ sqlpkg install asg017/ulid
$ sqlpkg install nalgeon/fileio
$ sqlpkg install nalgeon/crypto
$ sqlpkg install asg017/path
$ sqlpkg install asg017/html # https://github.com/asg017/sqlite-html/blob/main/docs.md
$ sqlpkg install asg017/http # https://github.com/asg017/sqlite-http/blob/main/docs.md
$ sqlpkg install asg017/regex # https://github.com/asg017/sqlite-regex/blob/main/docs.md
```

`cd`` to SQL Aide home and then run the following to match the extensions with
what's needed in SQL Aide:

```bash
$ sudo apt-get install rsync # if you don't already have it installed
$ rsync -av --delete ~/.sqlpkg/ ./support/bin/sqlpkg/
```
Binary file added support/bin/sqlpkg/asg017/html/html0.so
Binary file not shown.
40 changes: 40 additions & 0 deletions support/bin/sqlpkg/asg017/html/sqlpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"owner": "asg017",
"name": "html",
"version": "v0.1.3",
"repository": "https://github.com/asg017/sqlite-html",
"specfile": "https://github.com/nalgeon/sqlpkg/raw/main/pkg/asg017/html.json",
"authors": [
"Alex Garcia"
],
"license": "MIT",
"description": "Querying, manipulating, and creating HTML elements.",
"keywords": [
"sqlite-html"
],
"symbols": [
"html_attribute_get",
"html_attribute_has",
"html_count",
"html_debug",
"html_each",
"html_element",
"html_escape",
"html_extract",
"html_table",
"html_text",
"html_trim",
"html_unescape",
"html_version",
"html"
],
"assets": {
"path": "https://github.com/asg017/sqlite-html/releases/download/v0.1.3",
"files": {
"darwin-amd64": "sqlite-html-v0.1.3-loadable-macos-x86_64.tar.gz",
"darwin-arm64": "sqlite-html-v0.1.3-loadable-macos-aarch64.tar.gz",
"linux-amd64": "sqlite-html-v0.1.3-loadable-linux-x86_64.tar.gz",
"windows-amd64": "sqlite-html-v0.1.3-loadable-windows-x86_64.zip"
}
}
}
Binary file added support/bin/sqlpkg/asg017/http/http0.so
Binary file not shown.
45 changes: 45 additions & 0 deletions support/bin/sqlpkg/asg017/http/sqlpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"owner": "asg017",
"name": "http",
"version": "v0.1.1",
"repository": "https://github.com/asg017/sqlite-http",
"specfile": "https://github.com/nalgeon/sqlpkg/raw/main/pkg/asg017/http.json",
"authors": [
"Alex Garcia"
],
"license": "MIT",
"description": "Making HTTP requests purely in SQL.",
"keywords": [
"sqlite-http"
],
"symbols": [
"http_cookies",
"http_debug",
"http_do_body",
"http_do_headers",
"http_do",
"http_get_body",
"http_get_headers",
"http_get",
"http_headers_each",
"http_headers_get",
"http_headers_has",
"http_headers",
"http_post_body",
"http_post_form_urlencoded",
"http_post_headers",
"http_post",
"http_rate_limit",
"http_timeout_set",
"http_version"
],
"assets": {
"path": "https://github.com/asg017/sqlite-http/releases/download/v0.1.1",
"files": {
"darwin-amd64": "sqlite-http-v0.1.1-loadable-macos-x86_64.tar.gz",
"darwin-arm64": "sqlite-http-v0.1.1-loadable-macos-aarch64.tar.gz",
"linux-amd64": "sqlite-http-v0.1.1-loadable-linux-x86_64.tar.gz",
"windows-amd64": "sqlite-http-v0.1.1-loadable-windows-x86_64.zip"
}
}
}
Binary file added support/bin/sqlpkg/asg017/path/path0.so
Binary file not shown.
39 changes: 39 additions & 0 deletions support/bin/sqlpkg/asg017/path/sqlpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"owner": "asg017",
"name": "path",
"version": "v0.2.1",
"repository": "https://github.com/asg017/sqlite-path",
"specfile": "https://github.com/nalgeon/sqlpkg/raw/main/pkg/asg017/path.json",
"authors": [
"Alex Garcia"
],
"license": "MIT",
"description": "Parsing, generating, and querying paths.",
"keywords": [
"sqlite-path"
],
"symbols": [
"path_absolute",
"path_basename",
"path_debug",
"path_dirname",
"path_extension",
"path_intersection",
"path_join",
"path_name",
"path_normalize",
"path_part_at",
"path_parts",
"path_root",
"path_version"
],
"assets": {
"path": "https://github.com/asg017/sqlite-path/releases/download/v0.2.1",
"files": {
"darwin-amd64": "sqlite-path-v0.2.1-loadable-macos-x86_64.tar.gz",
"darwin-arm64": "sqlite-path-v0.2.1-loadable-macos-aarch64.tar.gz",
"linux-amd64": "sqlite-path-v0.2.1-loadable-linux-x86_64.tar.gz",
"windows-amd64": "sqlite-path-v0.2.1-loadable-windows-x86_64.zip"
}
}
}
Binary file added support/bin/sqlpkg/asg017/regex/regex0.so
Binary file not shown.
43 changes: 43 additions & 0 deletions support/bin/sqlpkg/asg017/regex/sqlpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"owner": "asg017",
"name": "regex",
"version": "v0.2.3",
"repository": "https://github.com/asg017/sqlite-regex",
"specfile": "https://github.com/nalgeon/sqlpkg/raw/main/pkg/asg017/regex.json",
"authors": [
"Alex Garcia"
],
"license": "MIT",
"description": "Fast and performant regular expressions.",
"keywords": [
"sqlite-regex"
],
"symbols": [
"regex_capture",
"regex_captures",
"regex_debug",
"regex_find_all",
"regex_find",
"regex_print",
"regex_replace_all",
"regex_replace",
"regex_split",
"regex_valid",
"regex_version",
"regex",
"regexp",
"regexset_is_match",
"regexset_matches",
"regexset_print",
"regexset"
],
"assets": {
"path": "https://github.com/asg017/sqlite-regex/releases/download/v0.2.3",
"files": {
"darwin-amd64": "sqlite-regex-v0.2.3-loadable-macos-x86_64.tar.gz",
"darwin-arm64": "sqlite-regex-v0.2.3-loadable-macos-aarch64.tar.gz",
"linux-amd64": "sqlite-regex-v0.2.3-loadable-linux-x86_64.tar.gz",
"windows-amd64": "sqlite-regex-v0.2.3-loadable-windows-x86_64.zip"
}
}
}
32 changes: 32 additions & 0 deletions support/bin/sqlpkg/asg017/ulid/sqlpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"owner": "asg017",
"name": "ulid",
"version": "v0.2.1",
"repository": "https://github.com/asg017/sqlite-ulid",
"specfile": "https://github.com/nalgeon/sqlpkg/raw/main/pkg/asg017/ulid.json",
"authors": [
"Alex Garcia"
],
"license": "Apache-2.0 AND MIT",
"description": "Generating and working with ULIDs.",
"keywords": [
"sqlite-ulid"
],
"symbols": [
"ulid_bytes",
"ulid_datetime",
"ulid_debug",
"ulid_version",
"ulid_with_prefix",
"ulid"
],
"assets": {
"path": "https://github.com/asg017/sqlite-ulid/releases/download/v0.2.1",
"files": {
"darwin-amd64": "sqlite-ulid-v0.2.1-loadable-macos-x86_64.tar.gz",
"darwin-arm64": "sqlite-ulid-v0.2.1-loadable-macos-aarch64.tar.gz",
"linux-amd64": "sqlite-ulid-v0.2.1-loadable-linux-x86_64.tar.gz",
"windows-amd64": "sqlite-ulid-v0.2.1-loadable-windows-x86_64.zip"
}
}
}
Binary file added support/bin/sqlpkg/asg017/ulid/ulid0.so
Binary file not shown.
Binary file added support/bin/sqlpkg/nalgeon/crypto/crypto.so
Binary file not shown.
35 changes: 35 additions & 0 deletions support/bin/sqlpkg/nalgeon/crypto/sqlpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"owner": "nalgeon",
"name": "crypto",
"version": "0.21.6",
"homepage": "https://github.com/nalgeon/sqlean/blob/main/docs/crypto.md",
"repository": "https://github.com/nalgeon/sqlean",
"specfile": "https://github.com/nalgeon/sqlpkg/raw/main/pkg/nalgeon/crypto.json",
"authors": [
"Anton Zhiyanov"
],
"license": "MIT",
"description": "Hashing, encoding and decoding data.",
"keywords": [
"sqlean-crypto"
],
"symbols": [
"decode",
"encode",
"md5",
"sha1",
"sha256",
"sha384",
"sha512"
],
"assets": {
"path": "https://github.com/nalgeon/sqlean/releases/download/0.21.6",
"pattern": "crypto*",
"files": {
"darwin-amd64": "sqlean-macos-x86.zip",
"darwin-arm64": "sqlean-macos-arm64.zip",
"linux-amd64": "sqlean-linux-x86.zip",
"windows-amd64": "sqlean-win-x64.zip"
}
}
}
Binary file added support/bin/sqlpkg/nalgeon/fileio/fileio.so
Binary file not shown.
42 changes: 42 additions & 0 deletions support/bin/sqlpkg/nalgeon/fileio/sqlpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"owner": "nalgeon",
"name": "fileio",
"version": "0.21.6",
"homepage": "https://github.com/nalgeon/sqlean/blob/main/docs/fileio.md",
"repository": "https://github.com/nalgeon/sqlean",
"specfile": "https://github.com/nalgeon/sqlpkg/raw/main/pkg/nalgeon/fileio.json",
"authors": [
"Richard Hipp",
"Anton Zhiyanov"
],
"license": "MIT",
"description": "Read and write files.",
"keywords": [
"sqlean-fileio"
],
"symbols": [
"fileio_append",
"fileio_ls",
"fileio_mkdir",
"fileio_read",
"fileio_scan",
"fileio_symlink",
"fileio_write",
"lsdir",
"lsmode",
"mkdir",
"readfile",
"symlink",
"writefile"
],
"assets": {
"path": "https://github.com/nalgeon/sqlean/releases/download/0.21.6",
"pattern": "fileio*",
"files": {
"darwin-amd64": "sqlean-macos-x86.zip",
"darwin-arm64": "sqlean-macos-arm64.zip",
"linux-amd64": "sqlean-linux-x86.zip",
"windows-amd64": "sqlean-win-x64.zip"
}
}
}

0 comments on commit a9419a0

Please sign in to comment.