Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

engine: new interpreter, query planner #1166

Merged
merged 8 commits into from
Dec 19, 2024
Merged

engine: new interpreter, query planner #1166

merged 8 commits into from
Dec 19, 2024

Conversation

brennanjl
Copy link
Collaborator

@brennanjl brennanjl commented Dec 17, 2024

Replaces #1070.

A quick explanation of what changed (aside from the planned features and syntax changes to the engine):

  • the parse module has been removed. All parsing is now done post-consensus (no parsers are needed by the client), so there was no longer a reason to keep it its own submodule.
  • There are no more transactions and CLI commands for deploying and dropping schemas. Everything is now done through a single RawStatement transaction, which takes any sort of statement create table, drop table, alter table, create action, and even insert/ update/delete. There is a basic roles system that controls who can do execute these statements.
  • There is a new field db_owner in the genesis file that specifies the initial schema owner. This is the first wallet that can create tables, actions, roles, etc.. This must be set for every network, since we no longer support anybody creating a schema.
  • The concept of having multiple "schemas" with "DBIDs" generated from the schema name and deployer been replaced. Instead, users can create new "namespaces" for their data. "Namespaces" have tables and actions, and are effectively equivalent to Postgres "schemas". I named them "namespaces" instead of "schemas" to avoid confusion when referencing Postgres schemas or table schemas. If no namespace is specified, it will use a default main namespace.
  • There are no more RPCs and CLI commands for reading schemas. There are also no more schema/table/action structs. There is instead a namespace called info where all data about the current schema can be queried.

@brennanjl brennanjl mentioned this pull request Dec 17, 2024
@brennanjl brennanjl marked this pull request as draft December 17, 2024 01:46
@brennanjl
Copy link
Collaborator Author

Still need to rip out a lot of old stuff

}
}

// valueToString converts a value to a string.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is an example of converting values to a string and back

@brennanjl brennanjl marked this pull request as ready for review December 18, 2024 23:06
@brennanjl brennanjl force-pushed the v0.10-sql-nodev2 branch 3 times, most recently from 3d80b29 to a2a2d11 Compare December 18, 2024 23:30
@brennanjl
Copy link
Collaborator Author

Will write a more in-depth write-up tomorrow

Taskfile.yml Outdated Show resolved Hide resolved
@@ -1141,7 +1141,7 @@ func (c *DataType) PGString() (string, error) {
scalar = "UINT256"
case DecimalStr:
if c.Metadata == ZeroMetadata {
return "", fmt.Errorf("decimal type must have metadata")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we can actually git rm -r _previous/core/types

jchappelow
jchappelow previously approved these changes Dec 19, 2024
Copy link
Member

@jchappelow jchappelow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A handful of nits aside, LGTM. 🚀

Comment on lines +1 to +5
/*
* A ANTLR4 grammar for Kuneiform.
* Developed by the Kwil team.
*/
parser grammar KuneiformParser;
Copy link
Member

@jchappelow jchappelow Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yaiba I guess you've been in the loop on the antlr parser bits? I haven't gotten into this file at all, but I got the broad strokes on the intent.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He should be. Quite a bit of the changes here were actually done by him

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah will take a look

ripping old engine out

replaced old engine

removed parse references

fixed lint issues

delete testdata

fix parse
@brennanjl brennanjl changed the title added engine v2 engine: new interpreter, query planner Dec 19, 2024
@brennanjl brennanjl merged commit c21d062 into main Dec 19, 2024
2 checks passed
@brennanjl brennanjl deleted the v0.10-sql-nodev2 branch December 19, 2024 20:00
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.

4 participants