aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGert-Jan Timmer <gjr.timmer@gmail.com>2018-05-29 12:03:18 +0200
committerGert-Jan Timmer <gjr.timmer@gmail.com>2018-05-29 12:03:18 +0200
commit4ab48f193516239cd4d3fc42769d41c078990348 (patch)
tree1ebacc85434a70d400889eb0797ee504297b5396
parentFix: pkey (diff)
downloadgolite-4ab48f193516239cd4d3fc42769d41c078990348.tar.gz
golite-4ab48f193516239cd4d3fc42769d41c078990348.tar.xz
Update Recursive Triggers
ADD: Multiple Key
-rw-r--r--README.md2
-rw-r--r--sqlite3.go9
2 files changed, 9 insertions, 2 deletions
diff --git a/README.md b/README.md
index eec00d8..3086586 100644
--- a/README.md
+++ b/README.md
@@ -79,7 +79,7 @@ Boolean values can be one of:
| Case Sensitive LIKE | `_cslike` | `boolean` | For more information see [PRAGMA case_sensitive_like](https://www.sqlite.org/pragma.html#pragma_case_sensitive_like) |
| Foreign Keys | `_foreign_keys` \| `_fk` | `boolean` | For more information see [PRAGMA foreign_keys](https://www.sqlite.org/pragma.html#pragma_foreign_keys) |
| Mutex Locking | `_mutex` | <ul><li>no</li><li>full</li></ul> | Specify mutex mode. |
-| Recursive Triggers | `_recursive_triggers` | `boolean` | For more information see [PRAGMA recursive_triggers](https://www.sqlite.org/pragma.html#pragma_recursive_triggers) |
+| Recursive Triggers | `_recursive_triggers` \| `_rt` | `boolean` | For more information see [PRAGMA recursive_triggers](https://www.sqlite.org/pragma.html#pragma_recursive_triggers) |
| Shared-Cache Mode | `cache` | <ul><li>shared</li><li>private</li></ul> | Set cache mode for more information see [sqlite.org](https://www.sqlite.org/sharedcache.html) |
| Time Zone Location | `_loc` | auto | Specify location of time format. |
| Transaction Lock | `_txlock` | <ul><li>immediate</li><li>deferred</li><li>exclusive</li></ul> | Specify locking behavior for transactions. |
diff --git a/sqlite3.go b/sqlite3.go
index b932305..4de18d6 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -961,7 +961,14 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
//
// https://www.sqlite.org/pragma.html#pragma_recursive_triggers
//
- if val := params.Get("_recursive_triggers"); val != "" {
+ pkey = "" // Reset pkey
+ if _, ok := params["_recursive_triggers"]; ok {
+ pkey = "_recursive_triggers"
+ }
+ if _, ok := params["_rt"]; ok {
+ pkey = "_rt"
+ }
+ if val := params.Get(pkey); val != "" {
switch strings.ToLower(val) {
case "0", "no", "false", "off":
recursiveTriggers = 0