Commit Graph

67 Commits

Author SHA1 Message Date
Artem Klevtsov
3e57c2f780 Improve db_postgres iterators (#18144)
* Fix pqSetSingleRowMode case. Add links to the docs

* Add missing PGContextVisibility enum

* Remove unused PGContextVisibility enum

* Improve db_postgres iterators

* Fix instantRows with DbColumns. Cosmetics.

* Reduce copy&paste in db_postgres

* Move pqclear inside loop
2021-06-03 14:41:57 +02:00
Thomas T. Jarløv
99788ee504 Escape %00 / \0 in dbQuote (#18015) [backport:1.4]
Fix https://github.com/nim-lang/Nim/issues/17925
2021-05-15 21:26:15 +02:00
Fröhlich A
5439cfc317 Fix insert calling wrong function (#17856)
The `insert` method is calling `tryInsertID`, which ignores the `pkName` parameter.
Calling `tryInsert` instead should be correct.
2021-04-29 14:11:05 +02:00
Danil Yarantsev
56461c280f Change stdlib imports to use std prefix in most examples (#17202) 2021-02-28 13:17:19 -08:00
flywind
9450bf6c08 use single backtick (#17100) 2021-02-18 22:47:21 -08:00
Juan Carlos
c9fdad2c21 db_postgres document how to use it with unix socket (#15187) 2020-08-17 08:39:58 +02:00
Bung
6668b43409 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 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>
2020-05-22 19:24:52 +02:00
Chris Heller
8d1a7db6ea Check pqntuples > 0 in getValue. Fixes #12973 (#12974) 2019-12-29 17:41:18 +01:00
Federico Ceratto
39290cf88c Fix spellings (#12277) [backport] 2019-09-27 07:02:54 +02:00
Chris Heller
343ace8194 Skip db_postgres.setRow if getRow returns 0 rows (#11859)
Fixes nim-lang/Nim#11821
2019-08-04 19:28:24 +02:00
Huy
e5425b5f2f [feature] add unsafeColumnAt procs, that return unsafe cstring from InstantRow (#11647) 2019-07-10 14:56:09 +02:00
Zed
3b4952da94 Fix header inconsistencies in documentation (#11071) 2019-04-23 08:40:20 +02:00
Araq
3f6168b337 removes deprecated T/P types 2018-11-16 13:27:56 +01:00
Andreas Rumpf
94684488d6 make more tests green 2018-08-14 21:15:03 +02:00
Andreas Rumpf
bb5bab1b74 make tests green again 2017-11-07 12:57:32 +01:00
Thomas Johnson
61a50d9c8c Fixes #6571 (#6578) 2017-10-24 10:48:45 +02:00
Lyndsy Simon
8ea78b1bc9 db_postgres: Refactor open() behavior to be consistent with other DBs (#6381) 2017-09-15 16:56:08 +02:00
ionel anton
636b977457 Column details for postgres. (#5380) 2017-02-13 09:09:43 +01:00
Dominik Picheta
6ca9e5cbcc Improved documentation for all db modules. 2016-01-18 13:34:53 +00:00
Dominik Picheta
a34206fe84 More postgres test code. Added getValue for PreparedStmts.
Ref #3569. Ref #3560.
2016-01-18 13:19:07 +00:00
Andreas Rumpf
a3c8bb9376 updated db*.nim modules 2015-12-16 21:24:13 +01:00
Andreas Rumpf
cb10f30656 big update for the db*.nim modules; uses new db_common.nim 2015-12-16 20:56:12 +01:00
Anatoly Galiulin
c017904363 Fixed issue 3513: wrong setupQuery realization 2015-11-06 10:24:23 +06:00
Dominik Picheta
82f3cab1ac Improved postgres docs and added untestable tests. 2015-10-27 11:06:00 +01:00
JamesP
a82b9cbda3 fix doco by removing extra ` chars, change a word and
line up multi-line text
2015-10-27 11:06:00 +01:00
JamesP
02d882cfbe add doco outlining the two SQL parameter substitution mechanisms for the db_postgres module
adjust doco note: indent by one space

shorten doco example lines, by splitting across multiple lines

shorten doco line widths by splitting long lines into multi-lines

fix to prepare() example in doco "Note:" section
2015-10-27 11:05:59 +01:00
JamesP
033c461a87 setupQuery() with SqlQuery take parameter substitution with "?"
add instantRows() with SqlPrepared parameter

fix setupQuery() for SqlQuery to produce a unique identiying query name

add rows() iterator with SqlPrepared parameter

add execAffectedRows for SqlPrepared
2015-10-27 11:05:59 +01:00
JamesP
b2a48b0ed6 tryExec() with SqlQuery now takes "?" substitution parameters
add tryExec() with SqlPrepared parameter

exec() with SqlQuery now expects "?" parameter substitution
2015-10-27 11:05:59 +01:00
JamesP
4e19106221 add check to dbFormat() to verify parameter substitution has "?" identifier
add check to prepare() that parameter substitution has "$1" identifier
2015-10-27 11:05:59 +01:00
Adam Strzelecki
43bddf62dd lib: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
2015-09-04 23:03:56 +02:00
Adam Strzelecki
8742907133 db: InstantRow and instantRows
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.
2015-06-09 20:53:03 +02:00
pdw
ea03fc6886 lib/impure - Dropped 'T' from types 2015-06-04 13:17:09 +02:00
KeMeGe
171d51a08c move database encoding options to setEncoding(), leave open() as it is 2015-03-16 13:53:38 +08:00
KeMeGe
ca8102b96d Add character set options when opening DB connection 2015-03-14 15:21:38 +08:00
Guillaume Gelin
3119fe087d Happy new year! 2015-01-06 15:26:33 +01:00
Araq
adad2d5f4a Merge branch 'devel' into bigbreak
Conflicts:
	lib/impure/db_postgres.nim
	lib/pure/json.nim
	lib/pure/math.nim
	lib/system/atomics.nim
2014-11-03 11:42:36 +01:00
Milos Negovanovic
2a203e5340 Add comment. 2014-10-21 15:56:00 +01:00
Araq
a9a5766c66 docgen should work again 2014-10-05 03:06:19 +02:00
Araq
fc47c0edc7 Merge branch 'devel' of https://github.com/Araq/Nimrod into bigbreak
Conflicts:
	lib/impure/db_postgres.nim
	lib/pure/os.nim
	lib/wrappers/postgres.nim
2014-10-04 19:40:23 +02:00
Milos Negovanovic
f59ac26b85 Tweaks for postgres driver (not tested yet). 2014-09-26 11:23:13 +01:00
Araq
d4bc11b654 cleaned up various modules 2014-09-19 00:54:01 +02:00
Dominik Picheta
0047172274 More docgen fixes. 2014-09-13 16:45:07 +01:00
Erwan Ameil
08f1c6100b Add postgresql prepared queries and stop relying on string formatting
for sql parameter passing
2014-08-29 11:29:19 +02:00
Araq
4523b29d7a Nimrod renamed to Nim 2014-08-28 09:59:26 +02:00
Araq
d05df2173b Nimrod renamed to Nim 2014-08-28 09:50:51 +02:00
Araq
346443d1b5 case consistency improvements 2014-01-11 21:56:05 +01:00
Hitesh Jasani
20661c9c46 Add docs for connecting to postgres with keyword/value connection
strings.
2013-12-04 14:01:25 -05:00
Grzegorz Adam Hankiewicz
72a3e21f28 Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
Araq
012a7b5522 Merge pull request #262 from gradha/pr_adds_some_documentation_to_db_modules
Documents NULL to "" db_* transformation and return values.
2012-11-24 17:54:04 -08:00
Grzegorz Adam Hankiewicz
cdd324d163 Documents NULL to "" db_* transformation and return values. 2012-11-24 20:41:26 +01:00