Skip to content

Conversation

@Dandandan
Copy link
Contributor

Issue: #225

See:
https://cloud.google.com/bigquery/docs/reference/standard-sql/debugging-statements
https://www.postgresql.org/docs/10/plpgsql-errors-and-messages.html

PostgreSQL supports an arbitrary expression as optional second message, so made that an expression as well.

@Dandandan Dandandan requested a review from nickolay July 15, 2020 18:39
@coveralls
Copy link

coveralls commented Jul 15, 2020

Pull Request Test Coverage Report for Build 171535046

  • 35 of 38 (92.11%) changed or added relevant lines in 3 files are covered.
  • 7 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.3%) to 91.588%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser.rs 11 12 91.67%
src/ast/mod.rs 7 9 77.78%
Files with Coverage Reduction New Missed Lines %
src/tokenizer.rs 1 91.68%
src/test_utils.rs 2 82.0%
src/parser.rs 4 89.02%
Totals Coverage Status
Change from base Build 169139020: -0.3%
Covered Lines: 4181
Relevant Lines: 4565

💛 - Coveralls

Copy link
Contributor

@nickolay nickolay left a comment

Choose a reason for hiding this comment

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

LGTM!

src/ast/mod.rs Outdated

/// ASSERT <condition> [AS <message>]
Assert {
condition: Box<Expr>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need Box here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed! Probably doesn't matter much in this case, and makes it easier to read. Would maybe be interesting in the future to see how much bytes we are using per struct (and impact on perf / memory).

Copy link
Contributor

Choose a reason for hiding this comment

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

I assume that the only two cases when we should use Box in our AST are: cycles (e.g. Expr) and when clippy reports a large_enum_variant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's probably a good heuristic indeed.

@Dandandan Dandandan merged commit c24b0e0 into main Jul 16, 2020
@Dandandan
Copy link
Contributor Author

Thanks!

@alamb alamb deleted the implement_assert branch February 5, 2022 13:08
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.

3 participants