Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gosqlite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gosqlite
Commits
60153e8a
Commit
60153e8a
authored
Dec 17, 2012
by
gwenn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Misc.
parent
c0e5c663
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
pragma.go
pragma.go
+14
-11
No files found.
pragma.go
View file @
60153e8a
...
@@ -4,6 +4,11 @@
...
@@ -4,6 +4,11 @@
package
sqlite
package
sqlite
/*
#include <sqlite3.h>
*/
import
"C"
import
(
import
(
"fmt"
"fmt"
"io"
"io"
...
@@ -137,20 +142,18 @@ func pragma(dbName, pragmaName string) string {
...
@@ -137,20 +142,18 @@ func pragma(dbName, pragmaName string) string {
return
Mprintf
(
"PRAGMA %Q."
+
pragmaName
,
dbName
)
return
Mprintf
(
"PRAGMA %Q."
+
pragmaName
,
dbName
)
}
}
func
(
c
*
Conn
)
oneValue
(
query
string
,
value
interface
{}
,
args
...
interface
{}
)
error
{
// no cache
func
(
c
*
Conn
)
oneValue
(
query
string
,
value
interface
{})
error
{
// no cache
s
,
err
:=
c
.
prepare
(
query
,
args
...
)
s
,
err
:=
c
.
prepare
(
query
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
defer
func
()
{
defer
s
.
finalize
()
s
.
Reset
()
rv
:=
C
.
sqlite3_step
(
s
.
stmt
)
s
.
finalize
()
err
=
Errno
(
rv
)
}()
if
err
==
Row
{
b
,
err
:=
s
.
Next
()
return
s
.
Scan
(
value
)
if
err
!=
nil
{
}
else
if
err
==
Done
{
return
err
}
else
if
!
b
{
return
io
.
EOF
return
io
.
EOF
}
}
return
s
.
Scan
(
value
)
return
s
.
error
(
rv
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment