Skip to content

Recipe Select - Rewrite of GlueSQL - #8

Merged
KyGost merged 27 commits into
MultiSQL:mainfrom
KyGost:recipe_select
May 8, 2021
Merged

KyGost merged 27 commits into
MultiSQL:mainfrom
KyGost:recipe_select

Conversation

@KyGost

@KyGost KyGost commented May 8, 2021 •

Copy link
Copy Markdown
Member

Rewrite

This is a complete rewrite of GlueSQL which increases query comprehension costs at the gain of much better query performance and much more universal evaluation.

Currently lacking when compared to GlueSQL (main)

  • Stability
    • This version is notably less stable than the main branch, primarly due to laziness
  • Newer updates
    • This version does not yet have DATE & TIME types as they were added in GlueSQL after I started this and after I made the current TIMESTAMPy functions for this version; TIMESTAMP data type is a todo, it should have full implicit conversion to INTEGER, potentially direct CAST into a formatted datetime for TEXT
  • IN
  • Subqueries
  • Careful memory management
    • While this version may have better memory statistics in some areas (though untested) the precision in memory management is far better in main; a key note is that out of laziness, a lot of Cloneing is currently present.

Further

Out of poor version control, I have put quite a many features in this one PR, here a list of non-recipe rewrite changes:

  • a number of additional functions:
    • CONVERT
    • TRY_CONVERT
    • LEN
    • CONCAT
    • REPLACE
    • NOW
    • YEAR
    • MONTH
    • DAY
    • HOUR
    • DATEADD
    • DATEFROMPARTS
    • ROUND
    • POW
    • IIF
    • IFNULL
    • NULLIF
  • CONVERT
    • Convert acts as CAST but with flexible data types and optional rules. Currently strings must be used for data type parameters but perhaps at some point I'll do some trickery to make that not needed.
    • Supports TIMESTAMP, DATETIME, DATE, TIME
  • MultiGlue
    • An (IMO) major feature to GlueSQL which allows for multiple storages to be used simultaneously, allowing cross database queries. (I have found notable use in being able to run queries on CSVs and then insert them into Sled).
    • A bit janky as of current, only properly supported in SELECT, other query types are a TODO.
  • CSV storage
  • CASE
  • Multithreading with Rayon
    • Intended to be optional but not yet implemented as optional
  • True aggregates (GlueSQL (main) only allows single columns)

Big note!

This version currently (as well as poor stability) has very poor testing both in test cases and in usage, primarly the former though (I have been using it for an extensive project thus it has good testing there)

KyGost added 27 commits April 5, 2021 02:36
Still many errors
Still unused
Lots of unwraps
This should make it cleaner to work with and faster in some ways.
Split up selection into stages.
Passing 2/30
More query support: UPDATE and DELETE reimplemented (no validation yet!)
Fixed a silly issue with constraints
Further corrected/updated tests
Adding ordering
Improved joining
Passing 14/30
Gave up on IN and Subqueries for now
Fixed up some tests
Fixed silly issues with aggregates
Added OFFSET support
Added HAVING support
Passing 23/30
Passing 26/30
Improved join
Implemented optimisation case for joins
Multithreading
Improved grouping
+ More
Passing 28/30
@KyGost
KyGost merged commit fa2623c into MultiSQL:main May 8, 2021
KyGost pushed a commit that referenced this pull request Apr 26, 2022
KyGost pushed a commit that referenced this pull request Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant