Skip to content

Commit 42af5ae

Browse files
author
Adrian Herridge
authored
Update SWSQLite.swift
1 parent 859e495 commit 42af5ae

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Sources/SWSQLite.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,15 @@ public class SWSQLite {
408408

409409
switch v.type {
410410
case .String:
411-
let s = v.stringValue!
411+
var s = v.stringValue!
412+
// check for special replacement strings
413+
414+
if s == "%uuid%" {
415+
s = uuid()
416+
} else if s == "%clustertime%" {
417+
s = timeuuid()
418+
}
419+
412420
sqlite3_bind_text(stmt, paramCount, s,Int32(s.characters.count) , SQLITE_TRANSIENT)
413421
case .Null:
414422
sqlite3_bind_null(stmt, paramCount)

0 commit comments

Comments
 (0)