summary refs log tree commit diff stats
path: root/lib/impure/db_sqlite.nim
Commit message (Collapse)AuthorAgeFilesLines
* make more standard libraries work with `nimPreviewSlimSystem` (#20343)ringabout2022-09-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | * make more standard libraries work with `nimPreviewSlimSystem` * typo * part two * Delete specutils.nim * fixes more tests * more fixes * fixes tests * fixes three more tests * add formatfloat import * fix * last
* make implicit cstring conversions explicit (#19488)ee72022-08-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Nim manual says that an implicit conversion to cstring will eventually not be allowed [1]: A Nim `string` is implicitly convertible to `cstring` for convenience. [...] Even though the conversion is implicit, it is not *safe*: The garbage collector does not consider a `cstring` to be a root and may collect the underlying memory. For this reason, the implicit conversion will be removed in future releases of the Nim compiler. Certain idioms like conversion of a `const` string to `cstring` are safe and will remain to be allowed. And from Nim 1.6.0, such a conversion triggers a warning [2]: A dangerous implicit conversion to `cstring` now triggers a `[CStringConv]` warning. This warning will become an error in future versions! Use an explicit conversion like `cstring(x)` in order to silence the warning. However, some files in this repo produced such a warning. For example, before this commit, compiling `parsejson.nim` would produce: /foo/Nim/lib/pure/parsejson.nim(221, 37) Warning: implicit conversion to 'cstring' from a non-const location: my.buf; this will become a compile time error in the future [CStringConv] /foo/Nim/lib/pure/parsejson.nim(231, 39) Warning: implicit conversion to 'cstring' from a non-const location: my.buf; this will become a compile time error in the future [CStringConv] This commit resolves the most visible `CStringConv` warnings, making the cstring conversions explicit. [1] https://github.com/nim-lang/Nim/blob/d2318d9ccfe6/doc/manual.md#cstring-type [2] https://github.com/nim-lang/Nim/blob/d2318d9ccfe6/changelogs/changelog_1_6_0.md#type-system
* Revert "fix db_sqlite.tryInsertID does raise exceptions in 1.6.0 #19743 ↵Andreas Rumpf2022-04-251-14/+11
| | | | | (#19744)" (#19745) This reverts commit b10f0e7bca43761316f6424786a771af33254e19.
* fix db_sqlite.tryInsertID does raise exceptions in 1.6.0 #19743 (#19744)flywind2022-04-241-11/+14
|
* db_sqlite: added a spaceAraq2022-03-181-1/+1
|
* fix a sqlite bug (#18669)flywind2021-08-121-11/+4
|
* docs: make inline markup more compatible with Markdown (#18053)Andrey Makarov2021-05-211-1/+1
| | | fixes https://github.com/timotheecour/Nim/issues/739
* fix RST parsing when no indent after enum.item (fix #17249) (#17257)Andrey Makarov2021-03-121-1/+1
|
* Change stdlib imports to use std prefix in most examples (#17202)Danil Yarantsev2021-02-281-3/+3
|
* use single backtick (#17100)flywind2021-02-181-9/+9
|
* fixes #16080 (#16091) [backport:1.2]RokkuCode2020-11-231-1/+1
| | | | | | | * fixes #16080 db_sqlite: Error: undeclared field: 'untypedLen' * redacting fix
* Handle BLOB column type in SQLite as binary data (#15681)Regis Caillaud2020-11-021-15/+78
| | | | | | * Fixed not handling blob correctly in sqlite * Fixed setLen commented by mistake * Added binary example as db_sqlite doc * Added tests for sqlite binary data
* add bindParams to db_sqlite (#14408)Bung2020-05-261-41/+159
| | | | | | | | | | | | | | | | | | | | | * add bindParams to db_sqlite * no need typeinfo * remove extro spaces * reduce bindParams to two branches,raise DbError * Update lib/impure/db_sqlite.nim * change bindParams to macro,accept varargs[untyped] as params * change bind blob val to openArray[byte] * remove unused err type * explicitly using i32 param * using import std/private/since * SQLITE_OK to right hand * bindParam val int using bindParam overload * copy data by default * change exec to template * remove SqlPrepared procs unused varargs * fix setupquery for prepared,reset first for exec prepared,add bindNull for literal nil Co-authored-by: alaviss <leorize+oss@disroot.org>
* add insert,tryInsert unify for postgres that need pk name (#14416)Bung2020-05-221-0/+15
| | | | | | | | | | | * add insert,tryInsert unify for postgres that need pk name * add ReadDbEffect to new procs * add .since and changelog * change since to 1.3 * Update lib/impure/db_postgres.nim Co-authored-by: bung87 <crc32@qq.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: alaviss <leorize+oss@disroot.org>
* add SqlPrepared api fix #13559 (#14365)Bung2020-05-161-0/+101
| | | Co-authored-by: bung87 <crc32@qq.com>
* fix #7241 (#13779)itsumura-h2020-04-031-0/+5
| | | finalize() should run in insert()
* Deprecate DCE:on (#13839)Juan Carlos2020-04-021-2/+0
|
* Documentation improvements around the db interface (#12362)Ray Imber2019-10-081-0/+12
| | | | Added more details about the limits and reasoning behind the API. Came about from this discussion on IRC: https://irclogs.nim-lang.org/04-10-2019.html#16:58:04
* removed unused imports [refactoring]Andreas Rumpf2019-08-081-1/+1
|
* makes the -d:nimIncremental compiler mode compile againAndreas Rumpf2019-07-271-5/+5
|
* [feature] add `unsafeColumnAt` procs, that return unsafe cstring from ↵Huy2019-07-101-0/+8
| | | | InstantRow (#11647)
* db_sqlite: Update documentation (#10330) (#11266)jiro2019-05-191-71/+359
|
* Fix header inconsistencies in documentation (#11071)Zed2019-04-231-6/+6
|
* fixes #7241Araq2019-01-131-10/+16
|
* removes deprecated T/P typesAraq2018-11-161-1/+0
|
* Update example (#9395)Federico Ceratto2018-10-171-1/+1
|
* make more tests greenAndreas Rumpf2018-08-141-1/+0
|
* Update sqlite example to use empty strings.Varriount2018-06-031-1/+1
| | | Update sqlite example to use empty strings to use empty strings instead of nil.
* Update example (#7788)Federico Ceratto2018-06-011-1/+1
|
* Better db_sqlite errors when db_sqlite not connected.Dominik Picheta2018-05-131-0/+3
|
* remove dead code elimination option (#7669)Jacek Sieka2018-04-231-1/+1
|
* make tests green againAndreas Rumpf2017-11-071-1/+1
|
* minor improvement for the db_sqlite moduleAndreas Rumpf2017-09-271-1/+2
|
* Improved documentation for all db modules.Dominik Picheta2016-01-181-1/+42
|
* new db_sqlite requires deadCodeElim:on because not every sqlite3_column_nameAndreas Rumpf2015-12-291-0/+2
|
* implements column information retrival for db_sqliteAndreas Rumpf2015-12-171-0/+33
|
* updated db*.nim modulesAndreas Rumpf2015-12-161-1/+1
|
* big update for the db*.nim modules; uses new db_common.nimAndreas Rumpf2015-12-161-46/+28
|
* Clean up a line endingJamesP2015-09-061-1/+1
|
* instantRows doco added "the" to improve readabilityJamesP2015-09-061-1/+1
|
* fastRows() iterator doco updated (similar to db_mysql) with sqlite specificJamesP2015-09-061-3/+7
| | | | [Edb] error text
* Add example (similar to db_mysql) with changes to table definitionJamesP2015-09-061-0/+30
| | | | and transaction to match sqlite SQL syntax
* lib: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-041-42/+42
| | | | via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
* db: InstantRow and instantRowsAdam Strzelecki2015-06-091-1/+23
| | | | | | | | | | | It is drop-in replacement for Row and fastRows, however instantRows returns a handle, not seq[string], so no Nim string is created until [] operator is called on the given handle. Also there is a len() proc returning number of columns in the handle. In some situations, when we iterate through many rows, but later we just read few columns this solution will be quicker than converting all column to Nim seq[string] on each iteration.
* lib/impure - Dropped 'T' from typespdw2015-06-041-30/+31
|
* Don't run non-test code when defined(testing)Oleh Prypin2015-04-211-1/+1
|
* move database encoding options to setEncoding(), leave open() as it isKeMeGe2015-03-161-4/+15
|
* Add character set options when opening DB connectionKeMeGe2015-03-141-2/+3
|
* fixes #1866Araq2015-01-101-1/+2
|
* updated db_sqlite.nimAraq2014-08-291-20/+20
|