vityaman / ydb

YDB is an open source Distributed SQL Database that combines high availability and scalability with strong consistency and ACID transactions
https://ydb.tech
Apache License 2.0
0 stars 0 forks source link

Design suggestion engine #3

Open vityaman opened 2 months ago

vityaman commented 2 months ago

In this issue, I need to design a suggestion engine based on ANTLRv4 & C3 architecture and think how it will be integrated into replxx. Also, I should consider design this in a way, that will permit switching to Tree Sitter, running in text editors in future for experiments.

Reference solution currently is WebSQL Autocomplete: https://github.com/gravity-ui/websql-autocomplete/tree/main/src/autocomplete/databases/yql

vityaman commented 2 months ago

This is how C3 matched rule RuleId_table is printed:

id_table, path: sql_query sql_stmt_list sql_stmt sql_stmt_core select_stmt select_kind_parenthesis select_kind_partial select_kind select_core join_source flatten_source named_single_source single_source table_ref table_key id_table_or_type an_id_table 
vityaman commented 2 months ago

Have an idea to wrap ANTLRv4 & C3 to my objects: https://gist.github.com/vityaman/70482b0dcfe0e78cc6a93c100619d080

vityaman commented 2 months ago

Note: ANTLRv4 C3 is not a thread safe library, it uses mutable static variables. Maybe need to make them thread_local

vityaman commented 2 months ago

There is a requirement that it should be made as simple as possible, without name suggestions, only keywords to start with.