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
7e10f97b
Commit
7e10f97b
authored
Mar 03, 2012
by
gwenn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove AUTOINCREMENT keyword.
parent
672aaeb9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
bench_test.go
bench_test.go
+2
-2
driver_test.go
driver_test.go
+1
-1
meta_test.go
meta_test.go
+4
-4
sqlite_test.go
sqlite_test.go
+1
-1
No files found.
bench_test.go
View file @
7e10f97b
...
...
@@ -7,7 +7,7 @@ import (
func
fill
(
db
*
Conn
,
n
int
)
{
db
.
Exec
(
"DROP TABLE IF EXISTS test"
)
db
.
Exec
(
"CREATE TABLE test (id INTEGER PRIMARY KEY
AUTOINCREMENT
, float_num REAL, int_num INTEGER, a_string TEXT)"
)
db
.
Exec
(
"CREATE TABLE test (id INTEGER PRIMARY KEY
NOT NULL
, float_num REAL, int_num INTEGER, a_string TEXT)"
)
s
,
_
:=
db
.
Prepare
(
"INSERT INTO test (float_num, int_num, a_string) VALUES (?, ?, ?)"
)
db
.
Begin
()
...
...
@@ -88,7 +88,7 @@ func BenchmarkNamedInsert(b *testing.B) {
db
,
_
:=
Open
(
""
)
defer
db
.
Close
()
db
.
Exec
(
"DROP TABLE IF EXISTS test"
)
db
.
Exec
(
"CREATE TABLE test (id INTEGER PRIMARY KEY
AUTOINCREMENT
,"
+
db
.
Exec
(
"CREATE TABLE test (id INTEGER PRIMARY KEY
NOT NULL
,"
+
" float_num REAL, int_num INTEGER, a_string TEXT)"
)
s
,
_
:=
db
.
Prepare
(
"INSERT INTO test (float_num, int_num, a_string)"
+
" VALUES (:f, :i, :s)"
)
...
...
driver_test.go
View file @
7e10f97b
...
...
@@ -7,7 +7,7 @@ import (
const
(
ddl
=
"DROP TABLE IF EXISTS test;"
+
"CREATE TABLE test (id INTEGER PRIMARY KEY
AUTOINCREMENT
,"
+
"CREATE TABLE test (id INTEGER PRIMARY KEY
NOT NULL
,"
+
" name TEXT);"
dml
=
"INSERT INTO test (name) values ('Bart');"
+
"INSERT INTO test (name) values ('Lisa');"
+
...
...
meta_test.go
View file @
7e10f97b
...
...
@@ -74,8 +74,8 @@ func TestColumn(t *testing.T) {
if
!
column
.
Pk
{
t
.
Errorf
(
"Expecting primary key flag to be true"
)
}
if
!
column
.
Autoinc
{
t
.
Errorf
(
"Expecting autoinc flag to be
tru
e"
)
if
column
.
Autoinc
{
t
.
Errorf
(
"Expecting autoinc flag to be
fals
e"
)
}
}
...
...
@@ -83,8 +83,8 @@ func TestForeignKeys(t *testing.T) {
db
:=
open
(
t
)
defer
db
.
Close
()
err
:=
db
.
Exec
(
"CREATE TABLE parent (id INTEGER PRIMARY KEY);"
+
"CREATE TABLE child (id INTEGER PRIMARY KEY, parentId INTEGER, "
+
err
:=
db
.
Exec
(
"CREATE TABLE parent (id INTEGER PRIMARY KEY
NOT NULL
);"
+
"CREATE TABLE child (id INTEGER PRIMARY KEY
NOT NULL
, parentId INTEGER, "
+
"FOREIGN KEY (parentId) REFERENCES parent(id));"
)
checkNoError
(
t
,
err
,
"error creating tables: %s"
)
fks
,
err
:=
db
.
ForeignKeys
(
"child"
)
...
...
sqlite_test.go
View file @
7e10f97b
...
...
@@ -25,7 +25,7 @@ func open(t *testing.T) *Conn {
func
createTable
(
db
*
Conn
,
t
*
testing
.
T
)
{
err
:=
db
.
Exec
(
"DROP TABLE IF EXISTS test;"
+
"CREATE TABLE test (id INTEGER PRIMARY KEY
AUTOINCREMENT
,"
+
"CREATE TABLE test (id INTEGER PRIMARY KEY
NOT NULL
,"
+
" float_num REAL, int_num INTEGER, a_string TEXT); -- bim"
)
checkNoError
(
t
,
err
,
"error creating table: %s"
)
}
...
...
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