fork github.com/doug-martin
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package db_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
dbv2 "git.fsdpf.net/go/db/v2"
|
||||
)
|
||||
|
||||
func ExampleRegisterDialect() {
|
||||
opts := dbv2.DefaultDialectOptions()
|
||||
opts.QuoteRune = '`'
|
||||
dbv2.RegisterDialect("custom-dialect", opts)
|
||||
|
||||
dialect := dbv2.Dialect("custom-dialect")
|
||||
|
||||
ds := dialect.From("test")
|
||||
|
||||
sql, args, _ := ds.ToSQL()
|
||||
fmt.Println(sql, args)
|
||||
|
||||
// Output:
|
||||
// SELECT * FROM `test` []
|
||||
}
|
||||
Reference in New Issue
Block a user