Skip to content

Commit

Permalink
Up to 1.7.8
Browse files Browse the repository at this point in the history
* URI db path support (issue #139)
* Up SQLite to 3.41.0
* Fix issues #128, #130, #131, #134
* Appy PR #132, #136, #137, #138
* Minor changes
  • Loading branch information
little-brother committed Mar 3, 2023
1 parent 3c23cae commit 1124f3b
Show file tree
Hide file tree
Showing 20 changed files with 7,100 additions and 3,273 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Small, simple, [powerfull](https://youtu.be/lctkqWD7HTk), fast, free.
* Demo database "Bookstore" for beginners
* Does not require installation

Need a much simpler tool? Try [sqlite-x](https://github.com/little-brother/sqlite-x)!

If you like the project, press the like-button on [AlternativeTo](https://alternativeto.net/software/sqlite-gui/about) or rate the app on [Softpedia](https://www.softpedia.com/get/Internet/Servers/Database-Utils/SQLite-GUI-LB.shtml) to support it.<br>
If you have any problems, comments or suggestions, check [Wiki](https://github.com/little-brother/sqlite-gui/wiki), create [issue](https://github.com/little-brother/sqlite-gui/issues) or just let me know <a href="mailto:lb.im@yandex.ru?subject=sqlite-gui">lb.im@yandex.ru</a>.
12 changes: 6 additions & 6 deletions extensions/icu.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
/*
** Un|Comment to provide additional unicode support to SQLite3 or adjust size for unused features
*/
#define SQLITE3_UNICODE_FOLD // ~ 10KB increase
//#define SQLITE3_UNICODE_FOLD // ~ 10KB increase
#define SQLITE3_UNICODE_LOWER // ~ 10KB increase
#define SQLITE3_UNICODE_UPPER // ~ 10KB increase
#define SQLITE3_UNICODE_TITLE // ~ 10KB increase
#define SQLITE3_UNICODE_UNACC // ~ 30KB increase
//#define SQLITE3_UNICODE_TITLE // ~ 10KB increase
//#define SQLITE3_UNICODE_UNACC // ~ 30KB increase
// _______________
// ~ 70KB increase

Expand Down Expand Up @@ -3029,13 +3029,13 @@ SQLITE_EXPORT int sqlite3_unicode_init(sqlite3 *db){
{"fold", 1, SQLITE_ANY, (void*)sqlite3_unicode_fold, caseFunc },
#endif
#ifdef SQLITE3_UNICODE_LOWER
{"lower", 1, SQLITE_ANY, (void*)sqlite3_unicode_lower, caseFunc },
{"lower", 1, SQLITE_ANY | SQLITE_DETERMINISTIC, (void*)sqlite3_unicode_lower, caseFunc },
#endif
#ifdef SQLITE3_UNICODE_UPPER
{"upper", 1, SQLITE_ANY, (void*)sqlite3_unicode_upper, caseFunc },
{"upper", 1, SQLITE_ANY | SQLITE_DETERMINISTIC, (void*)sqlite3_unicode_upper, caseFunc },
#endif
#ifdef SQLITE3_UNICODE_TITLE
{"title", 1, SQLITE_ANY, (void*)sqlite3_unicode_title, caseFunc },
{"title", 1, SQLITE_ANY | SQLITE_DETERMINISTIC, (void*)sqlite3_unicode_title, caseFunc },
#endif
#ifdef SQLITE3_UNICODE_UNACC
{"unaccent", 1, SQLITE_ANY, 0, unaccFunc },
Expand Down
8,960 changes: 6,253 additions & 2,707 deletions include/sqlite3.c

Large diffs are not rendered by default.

330 changes: 232 additions & 98 deletions include/sqlite3.h

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions include/sqlite3ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ struct sqlite3_api_routines {
const char *(*filename_journal)(const char*);
const char *(*filename_wal)(const char*);
/* Version 3.32.0 and later */
char *(*create_filename)(const char*,const char*,const char*,
const char *(*create_filename)(const char*,const char*,const char*,
int,const char**);
void (*free_filename)(char*);
void (*free_filename)(const char*);
sqlite3_file *(*database_file_object)(const char*);
/* Version 3.34.0 and later */
int (*txn_state)(sqlite3*,const char*);
Expand All @@ -357,6 +357,10 @@ struct sqlite3_api_routines {
unsigned char *(*serialize)(sqlite3*,const char *,sqlite3_int64*,
unsigned int);
const char *(*db_name)(sqlite3*,int);
/* Version 3.40.0 and later */
int (*value_encoding)(sqlite3_value*);
/* Version 3.41.0 and later */
int (*is_interrupted)(sqlite3*);
};

/*
Expand Down Expand Up @@ -681,6 +685,10 @@ typedef int (*sqlite3_loadext_entry)(
#define sqlite3_serialize sqlite3_api->serialize
#endif
#define sqlite3_db_name sqlite3_api->db_name
/* Version 3.40.0 and later */
#define sqlite3_value_encoding sqlite3_api->value_encoding
/* Version 3.41.0 and later */
#define sqlite3_is_interrupted sqlite3_api->is_interrupted
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */

#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
Expand Down
Binary file modified lib/x32/libsqlite3.a
Binary file not shown.
Binary file modified lib/x64/libsqlite3.a
Binary file not shown.
1 change: 1 addition & 0 deletions resources/help.sql
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ The unlikely(x) is equivalent to likelihood(x, 0.0625). ', 'select unlikely(3);'
('upper', 'function', 'upper (str)', 'Returns a copy of a string with all letter characters converted to uppercase.
Doesn''t work for non-ANSI symbols without icu extension.', 'select upper(''SQLite''); --> SQLITE', '', null, 1),
('zeroblob', 'function', 'zeroblob(n)', 'Returns a BLOB consisting of n bytes of 0x00.', 'select zeroblob(5);', '', null, 1),
('unhex', 'function', 'unhex(x, y)', 'Returns a BLOB value which is the decoding of the hexadecimal string x. Hexadecimal digits in Y have no affect on the translation of x. Only characters in y that are not hexadecimal digits are ignored in x.', 'select unhex(0xABC);', '', null, 1),

-- MATH
('acos', 'function', 'acos (n)', 'Returns the arc cosine of N (in the range of 0 to pi, expressed in radians).
Expand Down
47 changes: 47 additions & 0 deletions resources/init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
create table if not exists prefs (name text not null, value text, primary key (name));
create table if not exists recents (path text not null, time real not null, primary key (path));
create table if not exists history (query text not null, time real not null, primary key (query));
create table if not exists gists (query text not null, time real not null, primary key (query));
create table if not exists generators (type text, value text);
create table if not exists refs (dbname text not null, schema text not null, tblname text not null, colname text not null, refname text, query text, primary key (dbname, schema, tblname, colname));
create table if not exists disabled (dbpath text not null, type text not null, name text not null, sql text, primary key (dbpath, type, name));
create table if not exists pinned (dbname text not null, name text not null, primary key (dbname, name));
create table if not exists cli ("time" real, dbname text not null, query text not null, elapsed integer, result text);
create table if not exists diagrams (dbname text, tblname text, x integer, y integer, width integer, height integer, primary key (dbname, tblname));
create table if not exists main.encryption (dbpath text, param text, idc integer, value text, no integer, primary key (dbpath, param));
create table if not exists temp.encryption (dbpath text, param text, idc integer, value text, no integer, primary key (dbpath, param));
create table if not exists query_params (dbname text, name text, value text, primary key (dbname, name, value));
create table if not exists search_history ("time" real, what text, type integer, primary key (what, type));
create index if not exists idx_cli on cli ("time" desc, dbname);
create table if not exists help (word text primary key, type text, brief text, description text, example text, alt text, args json, nargs integer);
create table if not exists functions (id integer primary key autoincrement, name text, type integer default 0, language text default 'sql', code text, code2 text, code3 text, description text);
create table if not exists shortcuts as
select cast('Alt + F1' as text) name, cast(0x70 as integer) key, cast(0 as integer) ctrl, cast(1 as integer) alt,
'-- Columns
pragma table_info(''$SUB$'');
-- Foreign keys
pragma foreign_key_list(''$SUB$'');
-- DDL
select * from sqlite_master where tbl_name = ''$SUB$'';
-- First 10 rows
select * from ("$SUB$") limit 10;
-- Memory usage
select tosize(SUM(payload)) payload, tosize(SUM(pgsize)) total from dbstat where name = ''$SUB$'';' query
union select 'Ctrl + 1', 0x31, 1, 0,
'-- $SUB$
select * from "$SUB$" limit 100'
union select 'Ctrl + 2', 0x32, 1, 0,
'-- $SUB$
select count(*) from "$SUB$"'
union select 'Ctrl + 3', 0x33, 1, 0, NULL
union select 'Ctrl + 4', 0x34, 1, 0, NULL
union select 'Ctrl + 5', 0x35, 1, 0, NULL
union select 'Ctrl + 6', 0x36, 1, 0, NULL
union select 'Ctrl + 7', 0x37, 1, 0, NULL
union select 'Ctrl + 8', 0x38, 1, 0, NULL
union select 'Ctrl + 9', 0x39, 1, 0, NULL
union select 'Ctrl + 0', 0x30, 1, 0, NULL;
3 changes: 1 addition & 2 deletions sqlite-gui.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<Add option="-Os" />
<Add option="-std=c++11" />
<Add option="-m32" />
<Add option="-U__STRICT_ANSI__" />
<Add directory="include" />
</Compiler>
<Linker>
Expand All @@ -50,7 +49,6 @@
<Add option="-Os" />
<Add option="-std=c++11" />
<Add option="-m64" />
<Add option="-U__STRICT_ANSI__" />
<Add directory="include" />
</Compiler>
<Linker>
Expand Down Expand Up @@ -106,6 +104,7 @@
<Extensions>
<code_completion />
<debugger />
<envvars />
</Extensions>
</Project>
</CodeBlocks_project_file>
Loading

0 comments on commit 1124f3b

Please sign in to comment.