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
e3e38eeb
Commit
e3e38eeb
authored
Oct 03, 2014
by
gwenn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add binding to sqlite3_compileoption_used
parent
d956d9c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
config.go
config.go
+10
-0
config_test.go
config_test.go
+5
-0
No files found.
config.go
View file @
e3e38eeb
...
...
@@ -18,6 +18,8 @@ int goSqlite3Config(int op, int mode);
*/
import
"C"
import
"unsafe"
// ThreadingMode enumerates SQLite threading mode
// See ConfigThreadingMode
type
ThreadingMode
int32
...
...
@@ -117,3 +119,11 @@ func (c *Conn) queryOrSetEnableDbConfig(key, i C.int) (bool, error) {
func
(
c
*
Conn
)
EnableExtendedResultCodes
(
b
bool
)
error
{
return
c
.
error
(
C
.
sqlite3_extended_result_codes
(
c
.
db
,
btocint
(
b
)),
"Conn.EnableExtendedResultCodes"
)
}
// CompileOptionUsed returns false or true indicating whether the specified option was defined at compile time.
// (See http://sqlite.org/c3ref/compileoption_get.html)
func
CompileOptionUsed
(
optName
string
)
bool
{
cOptName
:=
C
.
CString
(
optName
)
defer
C
.
free
(
unsafe
.
Pointer
(
cOptName
))
return
C
.
sqlite3_compileoption_used
(
cOptName
)
==
1
}
config_test.go
View file @
e3e38eeb
...
...
@@ -63,3 +63,8 @@ func TestConnSettings(t *testing.T) {
err
:=
db
.
SetRecursiveTriggers
(
"main"
,
true
)
checkNoError
(
t
,
err
,
"SetRecursiveTriggers error: %s"
)
}
func
TestCompileOptionUsed
(
t
*
testing
.
T
)
{
b
:=
CompileOptionUsed
(
"SQLITE_ENABLE_COLUMN_METADATA"
)
assert
.
T
(
t
,
b
,
"COLUMN_METADATA disabled"
)
}
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