17 Commits

Author SHA1 Message Date
d90372127b Further fix for ISO8601 date parsing.
Recognize versions of timestamps with 'T' as the date/time separator.
For example, compare:

    '2021-08-01 23:14:00-05:00'
    '2021-08-01T23:14:00-05:00'

This commit adds support for the second flavor (and it's variations).
0.3.3
2021-08-01 23:14:18 -05:00
2b78727356 Fix for PostgreSQL timestamp with timezone fields.
The previous fix for PostgreSQL timestamp fields matched fields with and
without timezones, but did not properly parse values from fields that
included the timezone. Now we check for the presence of the timezone in
the date string and choose a format string to parse it correctly.
0.3.2
2021-07-05 11:24:06 -05:00
445c86f97e Shuffle variable declarations to make functions GC-safe. 0.3.1 2021-07-02 20:34:29 -05:00
126167fdaf Fix name mapping in field lookups generation. 2021-07-02 20:16:49 -05:00
ff0c5e5305 Update to support Nim 1.4.x+ 2021-04-02 13:58:08 -05:00
bdd62cad66 Add support for float data type. 0.3.0 2020-02-16 21:50:43 -06:00
b496b10578 Bump version number for 0.2.0 release. 0.2.0 2020-02-09 04:22:59 -06:00
c6430baa9a Support more ID types, allow creating records with known IDs.
* Previously all ID types needed to have the `isZero` function defined.
  This was named after the UUID.isZero function but does not describe
  the general case. Non-numeric is types will not be "zero," they will
  be "empty." Renamed to `isEmpty` and implemented basic versions of
  this for `int`, `string`, and `UUID`.

* Previously newly created records were not allowed to have ids set.
  Fiber required them to be set in the database and the caller to
  retrieve the newly generated ID from the newly created record. This is
  not really a decision that Fiber should make in a general case. There
  are valid reasons for both possibilities (creating the id in the
  application code vs. creating the id in the database layer). As a
  more general-purpose solution Fiber now leaves this to the caller.

  If the caller provides an id value, Fiber will include it in the
  INSERT statement. If the id is unset, Fiber will not include it at
  all, allowing it to be generated in the database.
2020-01-02 18:55:46 -06:00
cd52c9860d Add support for enum values. 2020-01-02 18:55:38 -06:00
af755a8a8d Round out support for Option type model fields.
The Option type has two forms depending on the type of the wrapped value
(see https://nim-lang.org/docs/options.html#Option). We only supported
one of these previously. This commit adds support for the other type as
well.

Additionally, this fixes a compile error that was introduced into the
use of `isSome` in the generated code after Nim 1.0.
2020-01-02 18:51:38 -06:00
1f57e0dccc Fix support for PostgreSQL timestamp fields.
PostgreSQL uses a format similar to IS8601 but allows values expressed
with tenths or hundreths of seconds rather than just milliseconds.
`2020-01-01 12:34:98.3+00` as opposed to `2020-01-01 12:34:98.300+00`,
for example. The `times` module in the Nim stdlib supports only
milliseconds with exactly three digits. To bridge this gap we detect the
two unsupported cases and pad the fractional seconds out to millisecond
precision.
2020-01-02 18:46:54 -06:00
61e06842af Use the more intelligent pluralization method we built when generating findXsByField lookup functions. 2020-01-02 18:46:03 -06:00
934bb26cf3 Make the DB type object generic (not PmApiDb). 2020-01-02 18:44:44 -06:00
126c4f1c7c Make record not found error messages more descriptive. 2020-01-02 18:42:48 -06:00
56a257be2e Bump package version. 0.1.2 2019-12-25 20:36:03 -06:00
35af299fdc Rename module from 'fiber_orm_nim' to 'fiber_orm'. 0.1.1 2019-12-25 18:51:00 -06:00
f84849ecde Initial commit of Nim Fiber ORM
Initial code based on common db module developed as part of the Personal
Measure project.
0.1.0
2019-12-25 18:07:23 -06:00