Skip to content

Commit

Permalink
refactor: removed sqlite3 prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
nalgeon committed Apr 9, 2021
1 parent f38634f commit b9e61df
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 39 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,37 +37,37 @@ jobs:
- name: Download native SQLite extensions
shell: bash
run: |
curl -L https://github.com/sqlite/sqlite/raw/master/ext/misc/json1.c --output src/json1.c
curl -L https://github.com/sqlite/sqlite/raw/master/ext/misc/json1.c --output src/sqlite3-json1.c
- name: Build for Linux
if: matrix.os == 'ubuntu-latest'
run: |
gcc -fPIC -shared src/json1.c -o dist/json1.so -lm
gcc -fPIC -shared src/sqlite3math.c -o dist/sqlite3-math.so -lm
gcc -fPIC -shared src/sqlite3re.c src/re.c -o dist/sqlite3-re.so -lm
gcc -fPIC -shared src/sqlite3stats.c -o dist/sqlite3-stats.so -lm
gcc -fPIC -shared src/sqlite3unicode.c -o dist/sqlite3-unicode.so -lm
gcc -fPIC -shared src/sqlite3vsv.c -o dist/sqlite3-vsv.so -lm
gcc -fPIC -shared src/sqlite3-json1.c -o dist/json1.so -lm
gcc -fPIC -shared src/sqlite3-math.c -o dist/math.so -lm
gcc -fPIC -shared src/sqlite3-re.c src/re.c -o dist/re.so -lm
gcc -fPIC -shared src/sqlite3-stats.c -o dist/stats.so -lm
gcc -fPIC -shared src/sqlite3-unicode.c -o dist/unicode.so -lm
gcc -fPIC -shared src/sqlite3-vsv.c -o dist/vsv.so -lm
- name: Build for Windows
if: matrix.os == 'windows-latest'
run: |
gcc -shared -I. src/json1.c -o dist/json1.dll
gcc -shared -I. src/sqlite3math.c -o dist/sqlite3-math.dll
gcc -shared -I. src/sqlite3re.c src/re.c -o dist/sqlite3-re.dll
gcc -shared -I. src/sqlite3stats.c -o dist/sqlite3-stats.dll
gcc -shared -I. src/sqlite3unicode.c -o dist/sqlite3-unicode.dll
gcc -shared -I. src/sqlite3vsv.c -o dist/sqlite3-vsv.dll
gcc -shared -I. src/sqlite3-json1.c -o dist/json1.dll
gcc -shared -I. src/sqlite3-math.c -o dist/math.dll
gcc -shared -I. src/sqlite3-re.c src/re.c -o dist/re.dll
gcc -shared -I. src/sqlite3-stats.c -o dist/stats.dll
gcc -shared -I. src/sqlite3-unicode.c -o dist/unicode.dll
gcc -shared -I. src/sqlite3-vsv.c -o dist/vsv.dll
- name: Build for macOS
if: matrix.os == 'macos-latest'
run: |
gcc -fPIC -dynamiclib -I src src/json1.c -o dist/json1.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3math.c -o dist/sqlite3-math.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3re.c src/re.c -o dist/sqlite3-re.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3stats.c -o dist/sqlite3-stats.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3unicode.c -o dist/sqlite3-unicode.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3vsv.c -o dist/sqlite3-vsv.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3-json1.c -o dist/json1.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3-math.c -o dist/math.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3-re.c src/re.c -o dist/re.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3-stats.c -o dist/stats.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3-unicode.c -o dist/unicode.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3-vsv.c -o dist/vsv.dylib -lm
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ There are [precompiled binaries](https://github.com/nalgeon/sqlean/releases/late
CLI usage:

```
sqlite> .load ./sqlite3-stats
sqlite> .load ./stats
sqlite> select median(value) from generate_series(1, 100);
```

IDE usage:

```
select load_extension('/path/to/extension/sqlite3-stats');
select load_extension('/path/to/extension/stats');
select median(value) from generate_series(1, 100);
```

Expand All @@ -46,9 +46,9 @@ import sqlite3

connection = sqlite3.connect(":memory:")
connection.enable_load_extension(True)
connection.load_extension("./sqlite3-stats.so")
connection.load_extension("./stats.so")
connection.execute("select median(value) from generate_series(1, 100)")
connection.close()
```

You can specify any other supported extension instead of `sqlite3-stats`.
You can specify any other supported extension instead of `stats`.
2 changes: 1 addition & 1 deletion docs/json1.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This is the 'native' SQLite [JSON1 extension](https://sqlite.org/json1.html).
It's often compiled into SQLite build, but in case your build doesn't include it - I've compiled it separately.

[Download](https://github.com/nalgeon/sqlean/releases/latest)
Download: [Download](https://github.com/nalgeon/sqlean/releases/latest)

## Usage

Expand Down
4 changes: 2 additions & 2 deletions docs/math.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sqlite3-math: Math Functions
# math: Math Functions

Common math functions for SQLite versions before 3.35.
Extracted from SQLite 3.35.4 source code (`func.c`).
Expand All @@ -18,6 +18,6 @@ Provides following functions:
## Usage

```
sqlite> .load ./sqlite3-math
sqlite> .load ./math
sqlite> select sqrt(9);
```
4 changes: 2 additions & 2 deletions docs/re.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sqlite3-re: Regular Expressions
# re: Regular Expressions

Regexp search and replace functions for SQLite.
Adapted from [regexp.old](https://github.com/garyhouston/regexp.old) by Henry Spencer.
Expand Down Expand Up @@ -78,7 +78,7 @@ X$ X occurring at the end of the string
## Usage

```
sqlite> .load ./sqlite3-re
sqlite> .load ./re
sqlite> select regexp_like('abcdef', 'b.d');
```

Expand Down
4 changes: 2 additions & 2 deletions docs/stats.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sqlite3-stats: Statistics
# stats: Statistics

Common statistical functions for SQLite.
Adapted from [extension-functions.c](https://sqlite.org/contrib/) by Liam Healy.
Expand All @@ -22,6 +22,6 @@ Provides following functions:
## Usage

```
sqlite> .load ./sqlite3-stats
sqlite> .load ./stats
sqlite> select median(value) from generate_series(1, 100);
```
4 changes: 2 additions & 2 deletions docs/unicode.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sqlite3-unicode: Unicode string functions
# unicode: Unicode string functions

This extension implements true UNICODE functionality for SQLite in regards of case-insensitive comparison of unicode data and SQLite. It uses UNICODE mapping tables to provide the following to SQLite:

Expand Down Expand Up @@ -26,7 +26,7 @@ sqlite> select upper('привет');
After:

```
sqlite> .load ./sqlite3-unicode
sqlite> .load ./unicode
sqlite> select upper('hello');
HELLO
sqlite> select upper('привет');
Expand Down
4 changes: 2 additions & 2 deletions docs/vsv.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sqlite3-vsv: CSV files as virtual tables
# vsv: CSV files as virtual tables

Provides virtual table for working directly with CSV files, without importing data into the database. Useful for very large datasets.

Expand All @@ -9,7 +9,7 @@ Adapted from [vsv.c](http://www.dessus.com/files/vsv.c) by Keith Medcalf.
## Usage

```sql
.load ./sqlite3-vsv
.load ./vsv

create virtual table temp.vsv using vsv(...);
select * from vsv;
Expand Down
2 changes: 1 addition & 1 deletion src/sqlite3math.c → src/sqlite3-math.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static void piFunc(
#ifdef _WIN32
__declspec(dllexport)
#endif
int sqlite3_sqlitemath_init(
int sqlite3_math_init(
sqlite3 *db,
char **pzErrMsg,
const sqlite3_api_routines *pApi) {
Expand Down
2 changes: 1 addition & 1 deletion src/sqlite3re.c → src/sqlite3-re.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ static void regexp_replace(
#ifdef _WIN32
__declspec(dllexport)
#endif
int sqlite3_sqlitere_init(
int sqlite3_re_init(
sqlite3 *db,
char **pzErrMsg,
const sqlite3_api_routines *pApi) {
Expand Down
2 changes: 1 addition & 1 deletion src/sqlite3stats.c → src/sqlite3-stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ int RegisterExtensionFunctions(sqlite3 *db) {
}

#ifdef COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE
int sqlite3_sqlitestats_init(
int sqlite3_stats_init(
sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi) {
SQLITE_EXTENSION_INIT2(pApi);
RegisterExtensionFunctions(db);
Expand Down
2 changes: 1 addition & 1 deletion src/sqlite3unicode.c → src/sqlite3-unicode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3113,7 +3113,7 @@ SQLITE_EXPORT int sqlite3_unicode_init(sqlite3 *db) {
** this function to initialise unicode functionality.
*/
#ifndef SQLITE_CORE
SQLITE_EXPORT int sqlite3_sqliteunicode_init(
SQLITE_EXPORT int sqlite3_unicode_init(
sqlite3 *db,
char **pzErrMsg,
const sqlite3_api_routines *pApi) {
Expand Down
2 changes: 1 addition & 1 deletion src/sqlite3vsv.c → src/sqlite3-vsv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,7 @@ static sqlite3_module VsvModuleFauxWrite = {
__declspec(dllexport)
#endif
#endif
int sqlite3_sqlitevsv_init(
int sqlite3_vsv_init(
sqlite3 *db,
char **pzErrMsg,
const sqlite3_api_routines *pApi) {
Expand Down

0 comments on commit b9e61df

Please sign in to comment.