File tree Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Original file line number Diff line number Diff line change 7
7
"fmt"
8
8
"io"
9
9
"os"
10
- "time"
11
10
"unicode/utf8"
12
11
13
12
"github.com/domonda/go-sqldb"
@@ -26,19 +25,6 @@ func IsOtherThanErrNoRows(err error) bool {
26
25
return sqldb .IsOtherThanErrNoRows (err )
27
26
}
28
27
29
- // Now returns the result of the SQL now() function
30
- // using the sqldb.Connection from the passed context.
31
- // This is useful to get the timestamp of a
32
- // SQL transaction for use in Go code.
33
- func Now (ctx context.Context ) (time.Time , error ) {
34
- var now time.Time
35
- err := Conn (ctx ).QueryRow (`select now()` ).Scan (& now )
36
- if err != nil {
37
- return time.Time {}, err
38
- }
39
- return now , nil
40
- }
41
-
42
28
// DebugPrintConn prints a line to stderr using the passed args
43
29
// and appending the transaction state of the connection
44
30
// and the current time of the database using `select now()`
@@ -51,7 +37,7 @@ func DebugPrintConn(ctx context.Context, args ...any) {
51
37
args = append (args , "Isolation" , optsStr )
52
38
}
53
39
}
54
- now , err := Now (ctx )
40
+ now , err := Conn (ctx ). Now ( )
55
41
if err == nil {
56
42
args = append (args , "NOW():" , now )
57
43
} else {
You can’t perform that action at this time.
0 commit comments