diff --git a/advanced.html b/advanced.html index a61bbb45..2e6c007e 100644 --- a/advanced.html +++ b/advanced.html @@ -307,6 +307,21 @@ + + +
Certain dialects of SQL ship with their own custom, non-standard column types, such as the jsonb
column in PostgreSQL. GORM supports loading several of such types, as listed in the following sections.
GORM supports loading the following PostgreSQL exclusive column types:
@@ -704,7 +683,7 @@Given the following Model definition:
+Given the following Model definition:
import (
"encoding/json"
"fmt"
@@ -714,14 +693,14 @@
)
type Document struct {
- Metadata postgres.Jsonb
- Secrets postgres.Hstore
+ Metadata postgres.Jsonb
+ Secrets postgres.Hstore
Body string
- ID int
+ ID int
}
-You may use the model like so:
+You may use the model like so:
password := "0654857340"
metadata := json.RawMessage(`{"is_archived": 0}`)
sampleDoc := Document{
@@ -770,12 +749,12 @@ fmt.Println("Inserted fields are as expected:&quo
-
+
-
+
@@ -786,7 +765,7 @@ fmt.Println("Inserted fields are as expected:&quo
diff --git a/documents/SUMMARY.md b/documents/SUMMARY.md
index 425a6397..9f5a22e4 100644
--- a/documents/SUMMARY.md
+++ b/documents/SUMMARY.md
@@ -14,6 +14,7 @@
* [Many To Many](associations.md#many-to-many)
* [Polymorphism](associations.md#polymorphism)
* [Association Mode](associations.md#association-mode)
+ * [Dialect Specific Data Type](dialects.md#dialect-data-type)
* [CRUD: Reading and Writing Data](crud.md)
* [Create](crud.md#create),
* [Query](crud.md#query),
@@ -32,6 +33,4 @@
* [Development](development.md)
* [Architecture](development.md#architecture)
* [Write Plugins](development.md#write-plugins)
-* [Dialects](dialects.md)
- * [Dialect Specific Columns](dialects.md#dialect-specific-columns)
* [Change Log](changelog.md)
diff --git a/documents/dialects.md b/documents/dialects.md
index 2c56a48f..f53cb064 100644
--- a/documents/dialects.md
+++ b/documents/dialects.md
@@ -2,17 +2,19 @@
-## Dialect Specific Columns
+## Dialect Specific Data Type
-Certain dialects of SQL ship with their own custom, non-standard column types, such as the ```jsonb``` column in PostgreSQL. GORM supports loading several of such types, as listed in the following sections.
+Certain dialects of SQL ship with their own custom, non-standard column types, such as the `jsonb` column in PostgreSQL. GORM supports loading several of such types, as listed in the following sections.
#### PostgreSQL
+
GORM supports loading the following PostgreSQL exclusive column types:
- jsonb
- hstore
-Given the following Model definition:
-````go
+Given the following Model definition:
+
+```go
import (
"encoding/json"
"fmt"
@@ -22,17 +24,17 @@ import (
)
type Document struct {
- Metadata postgres.Jsonb
- Secrets postgres.Hstore
+ Metadata postgres.Jsonb
+ Secrets postgres.Hstore
Body string
- ID int
+ ID int
}
-````
+```
-You may use the model like so:
+You may use the model like so:
-````go
+```go
password := "0654857340"
metadata := json.RawMessage(`{"is_archived": 0}`)
sampleDoc := Document{
@@ -54,5 +56,4 @@ secretsIsEqual := reflect.DeepEqual( resultDoc.Secrets, resultDoc.Secrets)
//this should print "true"
fmt.Println("Inserted fields are as expected:", metadataIsEqual && secretsIsEqual)
-````
-
+```
diff --git a/index.html b/index.html
index 61e943b5..079f5212 100644
--- a/index.html
+++ b/index.html
@@ -305,6 +305,21 @@
+