Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable style:usages for stdlib tests [backport: 1.6] #19715

Merged
merged 7 commits into from
Apr 13, 2022

Conversation

ringabout
Copy link
Member

No description provided.

@ringabout ringabout changed the title enable style:usages for stdlib tests enable style:usages for stdlib tests [backport: 1.6] Apr 12, 2022
@@ -150,25 +150,25 @@ proc tryExec*(db: DbConn, query: SqlQuery, args: varargs[string, `$`]): bool {.
tags: [ReadDbEffect, WriteDbEffect].} =
## tries to execute the query and returns true if successful, false otherwise.
var q = dbFormat(query, args)
return mysql.realQuery(PMySQL db, q, q.len) == 0'i32
return mysql.real_query(PMySQL db, q, q.len) == 0'i32
Copy link
Member Author

Choose a reason for hiding this comment

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

I would like to use camelCase, however the whole file of mysql.nim uses snake_case. So I decide to live with it now.

Copy link
Contributor

Choose a reason for hiding this comment

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

what we've done in such cases is to separate the pure C API into a private module that does nothing else than importc, then add a wrapper on top that makes the wrapper convenient to use from nim - this works pretty well because it also separates the responsibilities of the various modules along a clean line

tests/stdlib/tparsesql.nim Outdated Show resolved Hide resolved
tests/stdlib/tsqlparser.nim Outdated Show resolved Hide resolved
@Araq
Copy link
Member

Araq commented Apr 12, 2022

See my remarks. Otherwise it's excellent.

@Araq Araq merged commit 98cebad into nim-lang:devel Apr 13, 2022
narimiran pushed a commit that referenced this pull request May 24, 2022
* enable style:usages for stdlib tests

* freeAddrInfo

* more tests

* importc

* bufSize

* fix more

* => parseSql and renderSql

(cherry picked from commit 98cebad)
ringabout added a commit that referenced this pull request Dec 1, 2022
* enable style:usages for stdlib tests

* freeAddrInfo

* more tests

* importc

* bufSize

* fix more

* => parseSql and renderSql
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