Skip to main content

Release v0.14

ยท 11 min read
Taehoon Moon

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โ€‹

๐Ÿ€ Functions - APPEND, PREPEND, RAND, FIND_IDX, INITCAP and CALC_DISTANCEโ€‹

๐Ÿ€ 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;

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โ€‹

Composite Storageโ€‹

  • Add CompositeStorage which bundles multiple storages @panarch (#1068)

IndexedDB Storageโ€‹

Web Storageโ€‹

  • Add WebStorage - support localStorage \& sessionStorage for web browsers @panarch (#1050)

๐Ÿ€ Other new featuresโ€‹

๐ŸŒŠ Interface Changesโ€‹

  • Remove Store trait related cfg features, @panarch (#1091)
  • Refactor CreateTable.columns from Vec<ColumnDef> to Option<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โ€‹

๐ŸŒณ Documentationโ€‹

We now provide an official documentation website at https://gluesql.org/docs

Docs - setupโ€‹

๐Ÿ“‹ Testsโ€‹

๐Ÿ› 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 to u128 not to use parse_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 handle CTAS and ITAS adding unit test @devgony (#1074)
  • Fix test-suite tester functions to show (found, expected) shape @panarch (#1028)