cgen: fix orm shared conn on sql expr#26610
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc5a1360e8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| mut db_ctype_name := g.styp(db_expr_type.clear_flag(.shared_f)) | ||
| is_pointer := db_ctype_name.ends_with('*') | ||
| reference_sign := if is_pointer { '' } else { '&' } |
There was a problem hiding this comment.
Detect pointer-ness before stripping shared flag
db_ctype_name is now computed from db_expr_type.clear_flag(.shared_f), so is_pointer becomes false for shared ORM connections whose underlying DB type is a struct (for example shared sqlite.DB). With the new shared-path writes, that produces generated C like &&...->val instead of &...->val in the connection initializer, which causes sql statements using shared DB connections to fail to compile.
Useful? React with 👍 / 👎.
|
Oops, needed a test @felipensp |
Fix #26479