summary refs log tree commit diff stats
path: root/lib/impure/db_postgres.nim
Commit message (Collapse)AuthorAgeFilesLines
* build the documentation of official packages (#20986)ringabout2022-12-061-647/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove db stuffs * remove punycode * remove * fixes script * add cloner * patches * disable * patch * fixes external packages * disable two packages * preview documentation build * try again * fixes URL * fixes a bug * simplify * fixes documentaion * fixes * Apply suggestions from code review
* Fix several memory leaks in the Postgres wrapper. (#20940)jfilby2022-11-271-11/+18
|
* Markdown code blocks migration part 7 (#20547)Andrey Makarov2022-10-121-20/+25
|
* refactor dbFormat (#19746)ringabout2022-09-291-14/+2
| | | | | * refactor dbFormat * add simple tests
* Implement Pandoc Markdown concise link extension (#20304)Andrey Makarov2022-09-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement Pandoc Markdown concise link extension This implements https://github.com/nim-lang/Nim/issues/20127. Besides reference to headings we also support doing references to Nim symbols inside Nim modules. Markdown: ``` Some heading ------------ Ref. [Some heading]. ``` Nim: ``` proc someFunction*() ... ... ## Ref. [someFunction] ``` This is substitution for RST syntax like `` `target`_ ``. All 3 syntax variants of extension from Pandoc Markdown are supported: `[target]`, `[target][]`, `[description][target]`. This PR also fixes clashes in existing files, particularly conflicts with RST footnote feature, which does not work with this PR (but there is a plan to adopt a popular [Markdown footnote extension](https://pandoc.org/MANUAL.html#footnotes) to make footnotes work). Also the PR fixes a bug that Markdown links did not work when `[...]` section had a line break. The implementation is straightforward since link resolution did not change w.r.t. RST implementation, it's almost only about new syntax addition. The only essential difference is a possibility to add a custom link description: form `[description][target]` which does not have an RST equivalent. * fix nim 1.0 gotcha
* make implicit cstring conversions explicit (#19488)ee72022-08-191-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Improve db_postgres iterators (#18144)Artem Klevtsov2021-06-031-62/+117
| | | | | | | | | | | | | | | * 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
* Escape `%00` / `\0` in `dbQuote` (#18015) [backport:1.4]Thomas T. Jarløv2021-05-151-1/+3
| | | Fix https://github.com/nim-lang/Nim/issues/17925
* Fix `insert` calling wrong function (#17856)Fröhlich A2021-04-291-1/+1
| | | | The `insert` method is calling `tryInsertID`, which ignores the `pkName` parameter. Calling `tryInsert` instead should be correct.
* Change stdlib imports to use std prefix in most examples (#17202)Danil Yarantsev2021-02-281-2/+2
|
* use single backtick (#17100)flywind2021-02-181-10/+10
|
* db_postgres document how to use it with unix socket (#15187)Juan Carlos2020-08-171-2/+22
|
* add insert,tryInsert unify for postgres that need pk name (#14416)Bung2020-05-221-0/+22
| | | | | | | | | | | * 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>
* Check pqntuples > 0 in getValue. Fixes #12973 (#12974)Chris Heller2019-12-291-4/+12
|
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-1/+1
|
* Skip db_postgres.setRow if getRow returns 0 rows (#11859)Chris Heller2019-08-041-2/+4
| | | Fixes nim-lang/Nim#11821
* [feature] add `unsafeColumnAt` procs, that return unsafe cstring from ↵Huy2019-07-101-0/+4
| | | | InstantRow (#11647)
* Fix header inconsistencies in documentation (#11071)Zed2019-04-231-5/+5
|
* removes deprecated T/P typesAraq2018-11-161-1/+0
|
* make more tests greenAndreas Rumpf2018-08-141-5/+2
|
* make tests green againAndreas Rumpf2017-11-071-13/+13
|
* Fixes #6571 (#6578)Thomas Johnson2017-10-241-8/+11
|
* db_postgres: Refactor open() behavior to be consistent with other DBs (#6381)Lyndsy Simon2017-09-151-4/+7
|
* Column details for postgres. (#5380)ionel anton2017-02-131-15/+167
|
* Improved documentation for all db modules.Dominik Picheta2016-01-181-1/+4
|
* More postgres test code. Added getValue for PreparedStmts.Dominik Picheta2016-01-181-1/+12
| | | | Ref #3569. Ref #3560.
* updated db*.nim modulesAndreas Rumpf2015-12-161-1/+1
|
* big update for the db*.nim modules; uses new db_common.nimAndreas Rumpf2015-12-161-50/+37
|
* Fixed issue 3513: wrong setupQuery realizationAnatoly Galiulin2015-11-061-6/+2
|
* Improved postgres docs and added untestable tests.Dominik Picheta2015-10-271-43/+42
|
* fix doco by removing extra ` chars, change a word andJamesP2015-10-271-7/+7
| | | | line up multi-line text
* add doco outlining the two SQL parameter substitution mechanisms for the ↵JamesP2015-10-271-1/+55
| | | | | | | | | | | | 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
* setupQuery() with SqlQuery take parameter substitution with "?"JamesP2015-10-271-3/+32
| | | | | | | | | | 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
* tryExec() with SqlQuery now takes "?" substitution parametersJamesP2015-10-271-5/+11
| | | | | | add tryExec() with SqlPrepared parameter exec() with SqlQuery now expects "?" parameter substitution
* add check to dbFormat() to verify parameter substitution has "?" identifierJamesP2015-10-271-0/+4
| | | | add check to prepare() that parameter substitution has "$1" identifier
* lib: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-041-18/+18
| | | | via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
* db: InstantRow and instantRowsAdam Strzelecki2015-06-091-0/+21
| | | | | | | | | | | 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-43/+45
|
* move database encoding options to setEncoding(), leave open() as it isKeMeGe2015-03-161-3/+8
|
* Add character set options when opening DB connectionKeMeGe2015-03-141-2/+3
|
* Happy new year!Guillaume Gelin2015-01-061-1/+1
|
* Merge branch 'devel' into bigbreakAraq2014-11-031-4/+11
|\ | | | | | | | | | | | | | | Conflicts: lib/impure/db_postgres.nim lib/pure/json.nim lib/pure/math.nim lib/system/atomics.nim
| * Add comment.Milos Negovanovic2014-10-211-1/+2
| |
| * Tweaks for postgres driver (not tested yet).Milos Negovanovic2014-09-261-2/+8
| |
* | docgen should work againAraq2014-10-051-6/+6
| |
* | Merge branch 'devel' of https://github.com/Araq/Nimrod into bigbreakAraq2014-10-041-29/+83
|\| | | | | | | | | | | | | Conflicts: lib/impure/db_postgres.nim lib/pure/os.nim lib/wrappers/postgres.nim
| * Add postgresql prepared queries and stop relying on string formattingErwan Ameil2014-08-291-28/+84
| | | | | | | | for sql parameter passing
* | cleaned up various modulesAraq2014-09-191-5/+5
| |
* | More docgen fixes.Dominik Picheta2014-09-131-29/+29
| |
* | Nimrod renamed to NimAraq2014-08-281-2/+2
| |