We now provide an official documentation website at https://gluesql.org/docs
๐ Featuresโ
๐ Schemaless data supportโ
GlueSQL now supports creating tables without a schema, allowing for both structured and unstructured data to be stored in the same table. To create a schemaless table, simply run CREATE TABLE without specifying any columns. For more information on querying schemaless data, please refer to the following link: querying schemaless data
CREATE TABLE Bar;
To insert values,
INSERT INTO Bar VALUES
('{ "name": "ast", "value": 30 }'),
('{ "name": "glue", "rate": 3.0, "list": [1, 2, 3] }'),
Then, selecting values from schemaless table is simple.
SELECT name, rate, list[0] FROM Bar WHERE name = 'glue';
e.g.
CREATE TABLE Names (id INTEGER, name TEXT);
INSERT INTO Names VALUES (1, 'glue'), (2, 'sql');
CREATE TABLE Logs;
INSERT INTO Logs VALUES
('{ "id": 1, "value": 30 }'),
('{ "id": 2, "rate": 3.0, "list": [1, 2, 3] }'),
('{ "id": 3, "rate": 5.0, "value": 100 }');
SELECT * FROM Names JOIN Logs ON Names.id = Logs.id;
/*
| id | list | name | rate | value |
|----|---------|------|------|-------|
| 1 | | glue | | 30 |
| 2 |[1, 2, 3]| sql | 3 | |
*/
๐ IndexedDB & WebStorage supports in JavaScript packageโ
GlueSQL supports handling in-memory, localStorage, sessionStorage, and even IndexedDB using the same SQL syntax. All you need to know is how to specify the ENGINE
when creating a table.
e.g.
CREATE TABLE Mem (mid INTEGER) ENGINE = memory;
CREATE TABLE Loc (lid INTEGER) ENGINE = localStorage;
CREATE TABLE Ses (sid INTEGER) ENGINE = sessionStorage;
CREATE TABLE Idb (iid INTEGER) ENGINE = indexedDB;
SELECT
mid, lid, sid, iid
FROM Mem
JOIN Loc
JOIN Ses
JOIN Idb;
๐ Data Types - UINT32
, UINT64
, UINT128
, POINT
and FLOAT32
โ
- implement f32 data type @pythonbrad (#1145)
- Implement geometric
POINT
Type and geometric functions @seonghun-dev (#1048) - Add
UINT32
,UINT64
andUINT128
data types @ChobobDev (#1019) - Add inet datatype @pythonbrad (#1080)
๐ Functions - APPEND
, PREPEND
, RAND
, FIND_IDX
, INITCAP
and CALC_DISTANCE
โ
- Feat : add calc_distance function @seonghun-dev (#1153)
- Add
PREPEND
function forLIST
data type @seonghun-dev (#1149) - add initcap function @pythonbrad (#1064)
- Implement
FIND_IDX
function @zmrdltl (#1100) - Implement Rand function @pythonbrad (#1063)
- Add Append Function to LIST DataType @seonghun-dev (#1047)
๐ Store traitsโ
User-level custom functionโ
By implementing both the CustomFunction and CustomFunctionMut traits, users can create, use, and delete user-level custom functions. Although GlueSQL plans to continuously add various functions, users may still find them insufficient. In such cases, users can create their own user-level custom functions to supplement the built-in functions. Additionally, if there are repetitive business logic codes, they can be stored as custom functions. e.g.
CREATE FUNCTION ADD_ONE (n INT, x INT DEFAULT 1) RETURN n + x;
SELECT ADD_ONE(10) AS test;
DROP FUNCTION ADD_ONE;
- Support user level sql function @pythonbrad (#1095)
Metadataโ
The Metadata trait is an optional implementation for providing additional metadata support in GlueSQL. GlueSQL does not enforce any specific metadata implementation, allowing custom storage developers to decide which type of metadata, such as create time, modify time, etc., they want to provide.
๐ Storagesโ
JSON Storageโ
- Add JsonStorage support to CLI @devgony (#1135)
- Rename
Jsonl
Storage toJson
Storage @devgony (#1128) - Support
JSON
format inJSONL storage
@devgony (#1123) - Support
Jsonl
Storage @devgony (#1053)
Composite Storageโ
IndexedDB Storageโ
Web Storageโ
๐ Other new featuresโ
- Wrap identifiers with double quote (
"
) atto_sql
@devgony (#1130) - Support Values Query at ASTBuilder @devgony (#1041)
- Support
Schema::from_ddl(ddl: &str) -> String
@devgony (#1089) - Support column alias for Table, Derived Table @ding-young (#1065)
- Support
TableFactor::{Derived, Dictionary, Series}
in AstBuilder @devgony (#1007)
๐ Interface Changesโ
- Remove Store trait related cfg features, @panarch (#1091)
- Refactor CreateTable.columns from
Vec<ColumnDef>
toOption<Vec<ColumnDef>>
@devgony (#1086) - Remove
MutResult
@panarch (#1073) - Update all store mut trait methods to take \&mut self @panarch (#1072)
- Change StoreMut interface to use \&mut self, not to take ownership @panarch (#1071)
- Modify default ColumnOption from NOT NULL to NULL @devgony (#997)
๐ Improvementsโ
- Add a case for insert with source @devgony (#1211)
- Apply workspace inheritance to remaining Cargo.toml in storages/, @panarch (#1181)
- Add nullable, key, default to
GLUE_TABLE_COLUMNS
@devgony (#1177) - Update core to bundle all errors using error module, @panarch (#1178)
- Update global Error enum to display with error module prefix @panarch (#1175)
- fix: typo @ever0de (#1161)
- Move the SCHEMA_PREFIX const into an impl in SledStorage @garypen (#1151)
- Merge evaluate_stateless into evaluate, @panarch (#1132)
- Remove memory-storage dep from JsonStorage/ Cargo.toml @panarch (#1131)
- Simplify JsonlStorage codes @panarch (#1126)
- Bump rust version to 1.68 @ever0de (#1125)
- Keep
Cargo.lock
@ever0de (#1121) - Replace closure to variable in
data/interval
module @ever0de (#1118) - Add
f64
support todata::Key
@panarch (#1114) - Add Ord impl for Key, @panarch (#1110)
- join_expr when in_subquery, exists expr in join constraint @ding-young (#1112)
- Split JS related GitHub action, @panarch (#1109)
- Fix error handling for
ilike
function onLiteral
being treated asโฆ @ever0de (#1107) - Remove
Rc
invalidate.rs
@ever0de (#1106) - Remove
Error::Storage
variant @ever0de (#1105) - Replace
Box::pin
tofutures_enum::Stream
@ever0de (#1103) - Remove stream unneeded map ok uses @panarch (#1104)
- Replace
TryStream
toStream
@ever0de (#1102) - Remove
Rc
fromColumnValidation
@ever0de (#1101) - Remove unneeded Rc uses in fetch_labels @panarch (#1098)
- Simplify TryStreamExt using codes in join executor, @panarch (#1097)
- Fix typo in plan/validate.rs @ever0de (#1093)
- Update IdbStorage to use Schema::{to_ddl, from_ddl} to manage schema โฆ @panarch (#1090)
- Update Cargo.toml files to inherit workspace level configs, @panarch (#1088)
- Add Error enum to core::prelude @panarch (#1087)
- Update
StringExt
implementation to usestr
@ever0de (#1082) - Add enum
StrSlice
under enumEvaluated
@zmrdltl (#999) - refactor plan::validate::Context.labels from String to str @devgony (#1079)
- Replace
dyn object
to generic @ever0de (#1075) - Implement ValidationContext(schema_map + alias) to enhance validation of ambiguous columns @devgony (#883)
- Remove
clone
incheck_table_factor
@ever0de (#1058) - Bump rust-toolchain version to
1.66
@ever0de (#1057) - Bump
sqlparser
version to0.30
@ever0de (#1056) - Replace
Box::pin
tofutures_enum
in aggregate module @ever0de (#1055) - Update js/ Cargo.toml to use gloo-utils for serde handling @panarch (#1049)
- Remove ast::ColumnOption and merge UNIQUE option to ColumnDef @panarch (#1044)
- Rewrite \& simplify plan/context.rs codes, @panarch (#1045)
- Move ast::ColumnOption::Default variant to ColumnDef @panarch (#1042)
- [AST-Builder] Remove unused prebuild nodes @ding-young (#1043)
- Remove data::RowError, @panarch (#1040)
- Reorder project in ASTBuilder (project -> ordery_by -> limit,offset) @devgony (#1039)
- Remove unused LimitOffsetNode in AST builder @panarch (#1038)
- Rename executor/ blend.rs module to project.rs @SaumyaBhushan (#1036)
- Add Debug to AST builder nodes @panarch (#1022)
- Bump rust toolchain version to 1.65 @ever0de (#1035)
- Remove
Content::Shared
variant in executor/RowContext
@ever0de (#1032) - Merge insert logics in row.rs \& execute.rs into executor/insert.rs @panarch (#1031)
- Merge FilterContext and BlendContext into RowContext @panarch (#1029)
- Update
data::Row
to contain columns @panarch (#1026) - Add LIST type support in CONCAT function @seonghun-dev (#1021)
- Remove LimitOffsetNode in AST builder @panarch (#1023)
- Fix typo @ever0de (#1020)
- Add NumericNode to handle numeric value inputs in AST builder @panarch (#1017)
- Update ValueError::InvalidJsonString error to show input text @panarch (#1018)
- Add null() func which makes NULL value in AST builder @panarch (#1016)
- Add --all-targets option to cargo clippy rust gh-action @panarch (#1015)
- Move import
ColumnOption
used only byalter-table
feature in ast-builder @ever0de (#1014) - Add value/ binary_op
Parital{Ord,Cmp}
impl macro @ever0de (#1013) - Change to use internal chrono errors in parsing datetime @ever0de (#1010)
- Resolve unreachable branch of
Value::position
@ever0de (#1012) - Apply binary_op macros to existing data types @ChobobDev (#987)
- chore: Use rust-cache action to cache dependencies @jongwooo (#1006)
- Group the import statements @yugeeklab (#1005)
- Make Tester::new async @ShaddyDC (#1004)
- Make MemoryStorage Store trait features optional, @panarch (#1003)
- Replace
double quotes
toidentifier
@devgony (#1001) - Change chrono
from_*
methods tofrom_*_opt
@ever0de (#1000) - Improve duplicate column names validation @devgony (#995)
- Register
lock
whenfetch_all_schemas
faceidle
@devgony (#996) - Merge ColumnOption::{Null, NotNull} into a single option @devgony (#986)
- Update rust.yml github action to test examples/ @panarch (#994)
๐ณ Documentationโ
We now provide an official documentation website at https://gluesql.org/docs
- Add documentation for CLI @devgony (#1183)
- Add ast_builder null handling doc @LEE026 (#1209)
- Add document of datetime current date and time for ast-builder @heewoneha (#1208)
- docs: write position and indexing docs @Bangseungjae (#1206)
- Add docs/formatting for ast_builder @sooyeonyim-t (#1200)
- Update math basic arithmetic docs for ast_builder @changi1122 (#1202)
- Add pattern-matching doc for ast_builder @LEE026 (#1199)
- Add ast builder Trimming function docs @Bangseungjae (#1197)
- Add doc about the function Date \& Time Conversion @heewoneha (#1196)
- add Docs/case conversion(upper, lower, InitCap) in ast builder @sooyeonyim-t (#1195)
- Add math conversion docs for ast_builder @changi1122 (#1192)
- Added documentation for the round, ceil, and floor functions in ast-builder @LEE026 (#1191)
- Add documentation layout for AstBuilder @devgony (#1184)
- Add documentation for Json Storage @devgony (#1170)
- Add documentation for math functions @panarch (#1173)
- Add doc for datetime, geometry, list \& map and other functions, @panarch (#1172)
- Add documentation for text functions in SQL @panarch (#1167)
- Write docs/ Supported Storages section contents, @panarch (#1165)
- Add SQL function list with categories to docs/ @panarch (#1166)
- Write docs/getting-started/javascript-web.md @panarch (#1159)
- Write docs/ Developing Custom Storages contents @panarch (#1155)
- docs: add newly added data type into README.md @ChobobDev (#1137)
- docs(readme): add discord icon to chat badge @LeoDog896 (#1122)
- docs(javascript): update examples link @LeoDog896 (#1108)
Docs - setupโ
- Add gh-action for docs build - runs on both push \& pr @panarch (#1215)
- Setup blog based on docusaurus, @panarch (#1212)
- Remove mdbook which is replaced by docs/ (docusaurus based) @panarch (#1164)
- Add docusaurus deployment github action setup @panarch (#1163)
- Update coverage, javascript and rust gh action to ignore
docs/**
paโฆ @panarch (#1168) - Update docs/ global styles, @panarch (#1156)
- Setup new documentation based on docusaurus @panarch (#1136)
๐ Testsโ
- Add ifnull test suite for ast_builder @LEE026 (#1207)
- Add datetime current date and time test case for ast builder @heewoneha (#1205)
- Add Position and Indexing test code @Bangseungjae (#1203)
- Add math basic arithmetic test case for ast_builder @changi1122 (#1201)
- Add testcase/formatting for ast_builder @sooyeonyim-t (#1198)
- Add pattern_matching test cases for ast_builder @LEE026 (#1194)
- Add test code function / text / trimming @Bangseungjae (#1190)
- Add Testcase/case conversion @sooyeonyim-t (#1193)
- Add datetime conversion test cases for ast_builder @heewoneha (#1187)
- Add math conversion test case for ast_builder @changi1122 (#1189)
- Add rounding test cases for ast_builder @LEE026 (#1186)
- Update delete and insert tests in test-suite/, @panarch (#1180)
- Remove gen-_transaction_dictionary_tests! in test-suite, @panarch (#1179)
- Refactor geometry function tests in test-suite, @panarch (#1176)
- Refactor SQL function tests in test-suite, @panarch (#1174)
- fix : fix missing intg test for new data type @ChobobDev (#1143)
- Add unit tests for
TryFrom<&Value> for Decimal
@ChobobDev (#1139) - Add "cli" unittest @pythonbrad (#1094)
- Add
core/data
module unit tests @pythonbrad (#1092)
๐ Bug Fixesโ
- Fix docusaurus pages/index broken link @panarch (#1214)
- Fix docs/ Discord GlueSQL channel invite link address @panarch (#1213)
- Fix InvalidJsonString error message replacing payload to fileName @devgony (#1185)
- Fix TryFrom
Value::Str
tou128
not to useparse_uuid
@ChobobDev (#1134) - Fix column alias with identifer for
TableFactor::Derived
@ding-young (#1119) - Pass data even when
deleted_by
is not present @ever0de (#1117) - Fix MemoryStorage \& WebStorage primary key support @panarch (#1115)
- Fix
plan::validate
to handleCTAS
andITAS
adding unit test @devgony (#1074) - Fix test-suite tester functions to show (found, expected) shape @panarch (#1028)