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
b45166a1
Commit
b45166a1
authored
Oct 15, 2011
by
gwenn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add binding to sqlite3_stmt_readonly.
parent
62d699a6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
README
README
+2
-0
sqlite.go
sqlite.go
+5
-0
sqlite_test.go
sqlite_test.go
+7
-0
No files found.
README
View file @
b45166a1
...
...
@@ -20,11 +20,13 @@ Conn#LastInsertRowid
Conn#Interrupt
Conn#Begin/BeginTransaction(type)/Commit/Rollback
Conn#GetAutocommit
Conn#EnableLoadExtension/LoadExtension
Stmt#ExecUpdate
Stmt#BindParameterCount/BindParameterIndex/BindParameterName
Stmt#ClearBindings
Stmt#ColumnCount/ColumnIndex(name)/ColumnName(index)/ColumnType
Stmt#ReadOnly
Blob:
ZeroBlobLength
...
...
sqlite.go
View file @
b45166a1
...
...
@@ -719,6 +719,11 @@ func (c *Conn) Close() os.Error {
return
nil
}
// Calls http://sqlite.org/c3ref/stmt_readonly.html
func
(
s
*
Stmt
)
ReadOnly
()
bool
{
return
C
.
sqlite3_stmt_readonly
(
s
.
stmt
)
==
1
;
}
// Calls http://sqlite.org/c3ref/enable_load_extension.html
func
(
c
*
Conn
)
EnableLoadExtension
(
b
bool
)
{
C
.
sqlite3_enable_load_extension
(
c
.
db
,
btocint
(
b
))
...
...
sqlite_test.go
View file @
b45166a1
...
...
@@ -177,6 +177,10 @@ func TestInsertWithStatement(t *testing.T) {
}
defer
s
.
Finalize
()
if
s
.
ReadOnly
()
{
t
.
Errorf
(
"update statement is not readonly"
)
}
paramCount
:=
s
.
BindParameterCount
()
if
paramCount
!=
3
{
t
.
Errorf
(
"bind parameter count error: %d <> 3"
,
paramCount
)
...
...
@@ -207,6 +211,9 @@ func TestInsertWithStatement(t *testing.T) {
cs
,
_
:=
db
.
Prepare
(
"SELECT COUNT(*) FROM test"
)
defer
cs
.
Finalize
()
if
!
cs
.
ReadOnly
()
{
t
.
Errorf
(
"update statement is not readonly"
)
}
if
ok
:=
Must
(
cs
.
Next
());
!
ok
{
t
.
Fatal
(
"no result for count"
)
}
...
...
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