-
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
0 parents
commit 01cd767
Showing
13 changed files
with
277,267 additions
and
0 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
sqlite/* linguist-vendored |
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,4 @@ | ||
.vscode | ||
a.out | ||
dist/ | ||
cwalk |
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,64 @@ | ||
COMMIT=$(shell git rev-parse HEAD) | ||
VERSION=$(shell cat VERSION) | ||
DATE=$(shell date +'%FT%TZ%z') | ||
|
||
CWALK_VERSION=$(shell jq '.version' cwalk/clib.json) | ||
|
||
LOADABLE_CFLAGS=-fPIC -shared | ||
|
||
ifeq ($(shell uname -s),Darwin) | ||
CONFIG_DARWIN=y | ||
else | ||
CONFIG_LINUX=y | ||
endif | ||
|
||
ifdef CONFIG_DARWIN | ||
LOADABLE_EXTENSION=dylib | ||
endif | ||
|
||
ifdef CONFIG_LINUX | ||
LOADABLE_EXTENSION=so | ||
endif | ||
TARGET_LOADABLE=dist/path0.$(LOADABLE_EXTENSION) | ||
|
||
DEFINE_SQLITE_PATH_DATE=-DSQLITE_PATH_DATE="\"$(DATE)\"" | ||
DEFINE_SQLITE_PATH_VERSION=-DSQLITE_PATH_VERSION="\"$(VERSION)\"" | ||
DEFINE_SQLITE_PATH_SOURCE=-DSQLITE_PATH_SOURCE="\"$(COMMIT)\"" | ||
DEFINE_SQLITE_PATH_CWALK_VERSION=-DSQLITE_PATH_CWALK_VERSION="\"$(CWALK_VERSION)\"" | ||
DEFINE_SQLITE_PATH=$(DEFINE_SQLITE_PATH_DATE) $(DEFINE_SQLITE_PATH_VERSION) $(DEFINE_SQLITE_PATH_SOURCE) $(DEFINE_SQLITE_PATH_CWALK_VERSION) | ||
|
||
clean: | ||
rm dist/* | ||
|
||
FORMAT_FILES=sqlite-path.h sqlite-path.c core_init.c | ||
format: $(FORMAT_FILES) | ||
clang-format -i $(FORMAT_FILES) | ||
|
||
loadable: $(TARGET_LOADABLE) $(TARGET_LOADABLE_NOFS) | ||
|
||
$(TARGET_LOADABLE): sqlite-path.c | ||
gcc -Isqlite -Icwalk/include \ | ||
$(LOADABLE_CFLAGS) \ | ||
$(DEFINE_SQLITE_PATH) \ | ||
$< -o $@ cwalk/src/cwalk.c | ||
|
||
dist/sqlite3-extra.c: sqlite/sqlite3.c core_init.c | ||
cat sqlite/sqlite3.c core_init.c > $@ | ||
|
||
test: | ||
make test-format | ||
make test-loadable | ||
|
||
test-format: SHELL:=/bin/bash | ||
test-format: | ||
diff -u <(cat $(FORMAT_FILES)) <(clang-format $(FORMAT_FILES)) | ||
|
||
test-loadable: $(TARGET_LOADABLE) | ||
python3 tests/test-loadable.py | ||
|
||
test-loadable-watch: $(TARGET_LOADABLE) | ||
watchexec -w sqlite-path.c -w $(TARGET_LOADABLE) -w tests/test-loadable.py --clear -- make test-loadable | ||
|
||
.PHONY: all clean format \ | ||
test test-watch test-format \ | ||
loadable test-loadable test-loadable-watch |
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,14 @@ | ||
## TODO | ||
|
||
- [ ] lib | ||
- [ ] `path_join(...args)` | ||
- [ ] `path_join(segment)` aggregate function | ||
- [ ] windows/unix? | ||
- [ ] test loadable | ||
- [ ] sqlite3 build | ||
- [ ] wasm build | ||
- [ ] debug w/ cwalk version | ||
- [ ] usecases | ||
- [ ] local fs, pair with `fsdir` | ||
- [ ] zipfile names | ||
- [ ] URLs |
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 @@ | ||
v0.0.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,9 @@ | ||
/* | ||
This file is appended to the end of a sqlite3.c amalgammation | ||
file to include sqlite3_lines functions/tables statically in | ||
a build. This is used for the demo CLI and WASM implementations. | ||
*/ | ||
#include "sqlite-path.h" | ||
int core_init(const char *dummy) { | ||
return sqlite3_auto_extension((void *)sqlite3_path_init); | ||
} |
Oops, something went wrong.