-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updat docs, fix many-to-many metadata
- Loading branch information
1 parent
277e270
commit 2adabf1
Showing
12 changed files
with
327 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
### Type Mappings | ||
# Coercion | ||
|
||
While retrieving the data from the database, HoneyEQL coerce the return value to the corresponding JVM type as mentioned in the below table. | ||
|
||
| Type | Postgres | MySQL | | ||
| ---------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- | | ||
| java.lang.Long | `integer`, `int`, `int2` `int4`, `smallint`, `smallserial`, `serial`, `serial2`, `serial4`, `bigint`,`int8`,`bigserial`,`serial8` | `SMALLINT`, `MEDIUMINT`, `INT`, `TINYINT UNSIGNED`, `SMALLINT UNSIGNED`, `MEDIUMINT UNSIGNED`, `YEAR`, `INT UNSIGNED`, `BIGINT` | | ||
| java.math.BigDecimal | `real`, `float4`, `float8`, `double precision`,`numeric`,`decimal` | `REAL`, `FLOAT`, `DOUBLE`, `DECIMAL`, `NUMERIC` | | ||
| java.lang.String | `bit`, `bit varying`, `char`, `character varying`, `varchar`, `citext`, `bpchar`, `macaddr8`, `text`, `money` | `CHAR`, `VARCHAR`, `TINYTEXT`, `TEXT`, `MEDIUMTEXT`, `LONGTEXT`, `ENUM`, `SET`, `BINARY`, `VARBINARY`, `TINYBLOB,` `BLOB`, `LONGBLOB`, `BIT` | | ||
| java.lang.Boolean | `boolean` | `TINYINT(1)`, `BIT(1)`| | ||
| java.util.UUID | `uuid` | -- | | ||
| java.time.LocalDate | `date`| `DATE`| | ||
| java.time.LocalTime | `time`, `time without time zone`| `TIME`| | ||
| java.time.OffsetTime | `timetz`, `time with time zone` | --| | ||
| java.time.LocalDateTime | `timestamp`, `timestamp without time zone` | `DATETIME`, `TIMESTAMP` | | ||
| java.time.OffsetDateTime| `timestamptz`, `timestamp with time zone` | -- | | ||
|
||
| Type | Postgres | MySQL | | ||
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| java.lang.Long | `integer`, `int`, `int2` `int4`, `smallint`, `smallserial`, `serial`, `serial2`, `serial4`, `bigint`,`int8`,`bigserial`,`serial8` | `SMALLINT`, `MEDIUMINT`, `INT`, `TINYINT UNSIGNED`, `SMALLINT UNSIGNED`, `MEDIUMINT UNSIGNED`, `YEAR`, `INT UNSIGNED`, `BIGINT` | | ||
| java.math.BigDecimal | `real`, `float4`, `float8`, `double precision`,`numeric`,`decimal` | `REAL`, `FLOAT`, `DOUBLE`, `DECIMAL`, `NUMERIC` | | ||
| java.lang.String | `bit`, `bit varying`, `char`, `character varying`, `varchar`, `citext`, `bpchar`, `macaddr8`, `text`, `money` | `CHAR`, `VARCHAR`, `TINYTEXT`, `TEXT`, `MEDIUMTEXT`, `LONGTEXT`, `ENUM`, `SET`, `BINARY`, `VARBINARY`, `TINYBLOB,` `BLOB`, `LONGBLOB`, `BIT` | | ||
| java.lang.Boolean | `boolean` | `TINYINT(1)`, `BIT(1)` | | ||
| java.util.UUID | `uuid` | -- | | ||
| java.time.LocalDate | `date` | `DATE` | | ||
| java.time.LocalTime | `time`, `time without time zone` | `TIME` | | ||
| java.time.OffsetTime | `timetz`, `time with time zone` | -- | | ||
| java.time.LocalDateTime | `timestamp`, `timestamp without time zone` | `DATETIME`, `TIMESTAMP` | | ||
| java.time.OffsetDateTime | `timestamptz`, `timestamp with time zone` | -- | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,55 @@ | ||
## TODO | ||
# Configuration | ||
|
||
During the initialization of the database adapter, HoneyEQL enables you to configure and override certain default behaviors of it. | ||
|
||
```clojure | ||
(ns .. | ||
(:require [honeyeql.db :as db])) | ||
|
||
(def db-spec ...) | ||
|
||
; using default behaviors | ||
(def db-adapter (db/initialize db-spec)) | ||
|
||
; overriding default behaviors | ||
(def heql-config {...}) | ||
(def db-adapter (db/initialize db-spec heql-config)) | ||
``` | ||
|
||
The `heql-config` is a map with the following keys. | ||
|
||
## EQL Mode | ||
|
||
`:eql/mode` - configures the EQL syntax | ||
|
||
### Possible Values | ||
|
||
* `:eql.mode/lenient` - Use EQL Lenient Syntax (default) | ||
* `:eql.mode/strict` - Use EQL Standard Syntax | ||
|
||
## Attribute Return As | ||
|
||
`:attr/return-as` - configures the naming convention of the attributes in the return values. | ||
|
||
### Possible Values | ||
|
||
* `:naming-convention/qualified-kebab-case` (default) | ||
```clojure | ||
; sample return value | ||
{:actor/first-name "PENELOPE" | ||
:actor/last-name "GUINESS"} | ||
``` | ||
|
||
* `:naming-convention/unqualified-kebab-case` | ||
```clojure | ||
; sample return value | ||
{first-name "PENELOPE" | ||
last-name "GUINESS"} | ||
``` | ||
|
||
* `:naming-convention/unqualified-camel-case` | ||
```clojure | ||
; sample return value | ||
{firstName "PENELOPE" | ||
lastName "GUINESS"} | ||
``` |
Oops, something went wrong.