mirror of
https://github.com/glebarez/go-sqlite.git
synced 2025-10-06 00:06:56 +08:00
driver: support _time_format DSN query param
Building on the _pragma query param support added in 508747c9
, support
a new _time_format query param.
If _time_format is set to "sqlite", written times use the time package
format "2006-01-02 15:04:05.999999999-07:00". This is the format
mattn/go-sqlite3 uses and is format 4 at
https://sqlite.org/lang_datefunc.html#time_values.
By default, times are formatted with time.Time.String. This maintains
compatibility with existing users of the driver.
Fixes #47
This commit is contained in:
@@ -9,13 +9,14 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"modernc.org/tcl"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"modernc.org/tcl"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -26,6 +27,10 @@ var (
|
||||
)
|
||||
|
||||
func TestTclTest(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping test in short mode")
|
||||
}
|
||||
|
||||
blacklist := map[string]struct{}{}
|
||||
switch runtime.GOARCH {
|
||||
case "386", "arm":
|
||||
|
Reference in New Issue
Block a user