Skip to content

Conversation

hiteshjasani
Copy link
Contributor

Changes will write sql statements out to STDOUT to help with debugging.

Sample usage:

import db_postgres

db_postgres.SQL_LOGGING = true

...
Exec(db, sql"create table tbl1(id serial primary key not null, one varchar(10), two smallint)", [])

# [create table tbl1(id serial primary key not null, one varchar(10), two smallint)]

@Araq
Copy link
Member

Araq commented Jan 16, 2014

I won't accept this. The Nimrodic way is entirely different: Write a macro that reads in the module, parseStmt it, iterates over any operations with a TSql argument and wrap that via an overloaded op. Then import db_sqlite_log instead of db_sqlite to get the logging version.

@Araq Araq closed this Feb 2, 2014
Clyybber pushed a commit to Clyybber/Nim that referenced this pull request Sep 16, 2023
## Summary

As preparation for the dedicated code-generator IR, remove unused
procedures and support for some obsolete AST shapes from all three
code generators.

## Details

The code generators still had leftover support for some AST shapes that
stopped reaching the code generators with the introduction of the MIR
phase. These were: 
* `nil`-as-a-statement
* non-bare `return` statements (i.e., return statements with a non-
  `nkEmpty` operand)
* bare `discard` statements

Support for these is removed and logic still considering them adjusted.

In addition, the `isSimpleExpr` and `isComplexValueType` procedures in
the C code generator are unused -- they're also removed.
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