Skip to content

Milestone 0 - ddx-core + scaffolding#3

Draft
alxmrs wants to merge 22 commits into
mainfrom
m0
Draft

Milestone 0 - ddx-core + scaffolding#3
alxmrs wants to merge 22 commits into
mainfrom
m0

Conversation

@alxmrs

@alxmrs alxmrs commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

WIP

@d33bs d33bs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice job!

/// `dialect` is used to *parse* the marker-bearing statement; the
/// identifier-folding policy used to *match* columns is this engine's
/// (`casing`) — pair them (e.g. `Ddx::for_duckdb()` with `DuckDbDialect`).
pub fn rewrite_sql(&self, sql: &str, dialect: &dyn Dialect) -> Result<String> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Consider also an "explain" interface so folks can inspect what happens before running.

/// expression `expr` (SQL text) with respect to the column `wrt` (a bare
/// column name), returning the derivative as SQL text — for embedding an
/// update rule where a marker can't reach (design.md §3.6).
pub fn differentiate_sql(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there an opportunity to make this more user-facing for interactive use?

/// unsupported construct is always one of these typed errors, never an
/// approximate or silently-zero derivative.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum DiffError {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Double checking: are error messages ergonomic, stating specific guidance for users when roadbumps occur?

);
}

// ---------------------------------------------------------------------------

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In the current form, are we able to retrieve multiple gradients at once using one call through SQL (instead of many individual calls)? There might be an opportunity to use a list / collection.

fn qualified_reference_to_the_owning_cte_alias_still_errors() {
// But v.s IS v's computed alias, so differentiating it as a non-wrt term
// still crosses the projection boundary and must error.
let err = Ddx::new()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seeing this made me wonder: could the project use a simple notebook or somehow interactive guidebook explaining this and other aspects?

Comment thread .github/workflows/ci.yml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like this addition! Consider also adding a Makefile or justfile which makes it super easy for developers to make these checks as code is created. This might also help with things like builds / etc.

Comment thread README.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Consider adding a CONTRIBUTING.md file for this project also.

Comment thread .github/workflows/ci.yml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Worth testing more than stable?

Comment thread .github/workflows/ci.yml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Worth testing more than stable?

Comment thread docs/design.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Consider adding a "SQL cookbook" for this project to help people quickly get up to speed on the value-add and what's possible (it's all there, we just need to make it easy to grasp within a moment!).

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.

2 participants