Repository navigation
Build against KipData/KiteSQL main; gate missing dialect hooks - #2
Merged
Merged
Conversation
…nImpl Drop PersistencePolicy, FunctionPack, and accepts_* from the default build; register fixed-arity Concat/ConcatWs/Round/Length/Hex/IsNull overloads and gate true variadics plus LAST_INSERT_ID behind hook features. Co-authored-by: Alex Skinner <alexskinner@users.noreply.github.com>
Implement parse via sqlparser rewrite then SqlParser Display+reparse, DataTypeMapper, comparison_type/boolean_text/begin_commits hooks, with_mysql() dialect builder, and install_mysql_functions. Drop fork-only trait methods; keep numeric helpers for tests and future hooks. Co-authored-by: Alex Skinner <alexskinner@users.noreply.github.com>
Pin kite_sql to upstream main, port SqlDialect::parse / DataTypeMapper / comparison coercion / session autocommit, register fixed-arity functions via Database::load, and keep behaviour that needs missing upstream hooks behind hook-* features. CI and SLT cover the default feature set only. Co-authored-by: Alex Skinner <alexskinner@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stops depending on
alexskinner/KiteSQLby pinningkite_sqlto KipData/KiteSQL main (2a57f09) and porting this crate onto the upstream dialect API. Behaviour that still needs hooks upstream does not have is kept behind optionalhook-*Cargo features (off by default) so the default build and CI stay green.Merged from the fork copy
Compared this repo (1210-line
lib.rs, pin8065036/ dual-mode) withalexskinner/KiteSQLkite_sql_mysqlon main (1312 lines) and the durability pined8d138(same 1210-line dialect as dual-mode):mysql_comparison_type,boolean_text, andbegin_commits_active_transactionwiring (fork main additions that map to upstream#406/#409).on_duplicate_key_update.sltandon_duplicate_key_update_fixes.sltintotests/slt_mysql/for when upsert lands (hook-upsert; not run in default CI).src/modules matched between this repo and the fork pins; no further source merge was required beyond the API port.Port to upstream APIs
SqlDialect::parse: sqlparser MySQL parse → AST rewrite → Display →SqlParser::with_type_mapper(self).with_set_autocommit()(Lower is private; Display+reparse is the practical path).DataTypeMapper:BIT, text types,BINARY,SERIAL→LogicalType.comparison_type/boolean_text/begin_commits_active_transaction.#407); no dialect flag needed.with_mysql()→DataBaseBuilder::dialect(MySqlDialect);install_mysql_functionsviaDatabase::load(CatalogKind::ScalarFunction(..)).accepts_*forms gated.Gated features (why)
hook-functions#412implicit-cast lookup +accepts_arity/accepts_any_args/return_type_for; FunctionRegistry/packshook-collationtext_collationhook on upstreamhook-nulls-firstnulls_firsthookhook-numeric-typingnumber_literal/arithmetic_return_type/avg_return_typehook-column-displayColumnTypeSpec/ display-type catalog mappinghook-identityAUTO_INCREMENT/LAST_INSERT_IDhookshook-diagnosticsmap_diagnostic/StatementPolicyhook-upsert#408not mergedEnabling these against current upstream main will not compile until the hooks exist. Documented in README Upstream status.
Test results (default features)
cargo check/cargo clippy --all-targets -- -D warnings: passcargo test: pass (hook-dependent integration cases#[ignore])cargo test --test slt_default: pass (backticks,tinyint_1,text_types,bit_type,serial_type,limit_offset,like_escape_case,cast_target_types,alter_table_add_column)CI updated to exercise the default feature set only (not
--all-features).Could not fully port yet
AVGtyping, display types, identity/LAST_INSERT_ID, warning codes,ON DUPLICATE KEY UPDATE, UDAFs, statement undo log.#412and the other hooks land.comparison_coercion.sltstill fails on cases beyondcomparison_type(e.g. boolean arithmetic in predicates).