Commit Graph

20743 Commits

Author SHA1 Message Date
ringabout
70a19c8db8 make more standard libraries work with nimPreviewSlimSystem (#20343)
* 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
2022-09-28 02:06:23 +08:00
ee7
4010ad7229 make implicit cstring conversions explicit (#19488)
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
2022-08-19 21:40:53 +02:00
Andreas Rumpf
14c6c1c695 Revert "fix db_sqlite.tryInsertID does raise exceptions in 1.6.0 #19743 (#19744)" (#19745)
This reverts commit b10f0e7bca.
2022-04-25 11:59:37 +02:00
flywind
33f668caaf fix db_sqlite.tryInsertID does raise exceptions in 1.6.0 #19743 (#19744) 2022-04-25 02:20:18 +08:00
Araq
c699f4b5ab db_sqlite: added a space 2022-03-18 14:17:54 +01:00
flywind
eaad754508 fix a sqlite bug (#18669) 2021-08-13 00:21:01 +08:00
Andrey Makarov
f3c0728405 docs: make inline markup more compatible with Markdown (#18053)
fixes https://github.com/timotheecour/Nim/issues/739
2021-05-21 07:54:20 +03:00
Andrey Makarov
b2d26fa9ca fix RST parsing when no indent after enum.item (fix #17249) (#17257) 2021-03-12 10:33:21 +03:00
Danil Yarantsev
89fe268007 Change stdlib imports to use std prefix in most examples (#17202) 2021-03-01 00:17:19 +03:00
flywind
fbb62a6c32 use single backtick (#17100) 2021-02-19 00:47:21 -06:00
RokkuCode
5b8ae3cbf4 fixes #16080 (#16091) [backport:1.2]
* fixes #16080

db_sqlite: Error: undeclared field: 'untypedLen'

* redacting fix
2020-11-23 15:15:55 +01:00
Regis Caillaud
42a503b069 Handle BLOB column type in SQLite as binary data (#15681)
* 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
2020-11-02 13:02:55 +01:00
Bung
d078a65a4d add bindParams to db_sqlite (#14408)
* add bindParams to db_sqlite
* no need typeinfo
* remove extro spaces
* reduce bindParams to two branches,raise DbError
* Update src/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>
2020-05-26 13:44:47 +08:00
Bung
69b6a2dc3a add insert,tryInsert unify for postgres that need pk name (#14416)
* 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 src/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>
2020-05-23 01:24:52 +08:00
Bung
2bfe76908d add SqlPrepared api fix #13559 (#14365)
Co-authored-by: bung87 <crc32@qq.com>
2020-05-16 21:50:04 +08:00
itsumura-h
0ac0f2e2c4 fix #7241 (#13779)
finalize() should run in insert()
2020-04-03 16:38:05 +09:00
Juan Carlos
90fe5e03af Deprecate DCE:on (#13839) 2020-04-01 21:58:43 -03:00
Ray Imber
8a40b19273 Documentation improvements around the db interface (#12362)
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
2019-10-08 02:24:06 -07:00
Andreas Rumpf
f20f3269fc removed unused imports [refactoring] 2019-08-08 16:51:41 +02:00
Andreas Rumpf
d11230ea13 makes the -d:nimIncremental compiler mode compile again 2019-07-21 16:41:46 +02:00
Huy
79654a8191 add unsafeColumnAt procs, that return unsafe cstring from InstantRow (#11647) 2019-07-10 19:56:09 +07:00
jiro
e02ee2c195 db_sqlite: Update documentation (#10330) (#11266) 2019-05-20 03:27:12 +09:00
Zed
fb481c0df8 Fix header inconsistencies in documentation (#11071) 2019-04-23 08:40:20 +02:00
Andreas Rumpf
ad45dcd223 Merge branch 'devel' into araq-quirky-exceptions 2019-02-08 17:18:17 +01:00
Araq
8c15451400 removes deprecated T/P types 2018-11-16 13:27:46 +01:00
Federico Ceratto
ed588265ca Update example (#9395) 2018-10-16 23:17:37 +01:00
Andreas Rumpf
ebdbdb0ca5 fixes merge conflict 2018-08-19 15:14:03 +02:00
Andreas Rumpf
f503ef5fd9 fixed merge conflict 2018-06-04 16:16:50 +02:00
Araq
e1b3dc208a fixes testament compilation 2018-05-14 17:45:44 +02:00
Jacek Sieka
870869d081 remove dead code elimination option (#7669) 2018-04-23 17:02:38 +08:00
Andreas Rumpf
a9a982c5e9 make tests green again 2017-11-07 12:57:32 +01:00
Andreas Rumpf
d409e7f4ba Merge branch 'devel' into araq 2017-10-02 08:31:38 +02:00
Araq
fdf460d131 Merge branch 'devel' of https://github.com/nim-lang/Nim into devel 2016-01-18 14:54:50 +01:00
Araq
a6664bf8e3 Merge branch 'devel' of https://github.com/nim-lang/Nim into devel 2016-01-18 10:55:23 +01:00
Dominik Picheta
e6e5e86f5c Merge pull request #3294 from jlp765/db_sqliteDoco
Db sqlite doco update (similar to db_mysql)
2015-09-06 23:08:06 +01:00
Andreas Rumpf
46eb616a37 Merge pull request #3289 from nanoant/patch/fix-whitespace
Patch/fix whitespace
2015-09-04 23:37:59 +02:00
Andreas Rumpf
457ef2855b Merge pull request #2866 from nanoant/patch/db-deffered-rows
db: InstantRow and instantRows
2015-06-10 11:06:36 +02:00
pdw
118e4667b7 lib/impure - Dropped 'T' from types 2015-05-24 22:24:07 -05:00
Andreas Rumpf
5da8e91358 Merge pull request #2583 from BlaXpirit/test-stdlib
Test stdlib
2015-04-21 15:36:37 +02:00
Andreas Rumpf
4998c99d05 Merge pull request #2337 from kemege/db_charset
Add character set options when opening DB connection, default to UTF-8
2015-03-17 01:32:26 +01:00
Araq
0a9ca2633f fixes #1866 2015-01-10 23:52:05 +01:00
Araq
c7703ec24f updated db_sqlite.nim 2014-08-29 00:16:12 +02:00
Araq
01c6a074c1 Nimrod renamed to Nim 2014-08-28 09:50:51 +02:00
Andreas Rumpf
bb3f67be0e resolved conflict 2014-04-10 01:47:20 +02:00
Araq
c90a02503b Merge branch 'master' of github.com:Araq/Nimrod 2013-03-17 16:44:31 +01:00
Araq
6201c0ba56 Merge branch 'master' of github.com:Araq/Nimrod 2012-11-25 11:03:27 +01:00
Araq
832dc48f89 fixes #250 2012-11-19 00:16:25 +01:00
Araq
d05879916d 'assert' hides EAssertionFailsure; stdlib makes use of 'tags' 2012-11-18 01:36:20 +01:00
Araq
79ced725f0 Merge branch 'master' of github.com:Araq/Nimrod 2012-10-20 18:48:49 +02:00
Araq
714341b1e3 bugfix: leak in db_sqlite.GetValue 2012-10-10 01:05:03 +02:00