Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sqlite3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
node-sqlite3
Commits
a4cdfdd2
Commit
a4cdfdd2
authored
Feb 23, 2011
by
Konstantin Käfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
automatically create test database on first test execution
parent
6cd00d98
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
Makefile
Makefile
+11
-4
createdb.js
test/support/createdb.js
+2
-4
No files found.
Makefile
View file @
a4cdfdd2
...
...
@@ -5,12 +5,18 @@ build:
clean
:
node-waf clean
db
:
@
if
!
[
-f
test
/support/big.db
]
;
then
\
echo
"Creating test database... This may take several minutes."
;
\
node
test
/support/createdb.js
;
\
fi
ifndef
only
test
:
build
expresso
-I
lib
test
/
*
.test.js
test
:
build
db
@
expresso
-I
lib
test
/
*
.test.js
else
test
:
build
expresso
-I
lib
test
/
${
only
}
.test.js
test
:
build
db
@
expresso
-I
lib
test
/
${
only
}
.test.js
endif
.PHONY
:
build clean test
\ No newline at end of file
test/support/createdb.js
View file @
a4cdfdd2
#!/bin/sh
var
sqlite3
=
require
(
'../../lib/sqlite3'
);
function
randomString
()
{
...
...
@@ -10,13 +9,13 @@ function randomString() {
return
str
;
};
var
db
=
new
sqlite3
.
Database
(
'big.db'
);
var
db
=
new
sqlite3
.
Database
(
'
test/support/
big.db'
);
var
count
=
10000000
;
db
.
serialize
(
function
()
{
db
.
run
(
"CREATE TABLE foo (id INT, txt TEXT)"
);
db
.
run
(
"BEGIN TRANSACTION"
);
var
stmt
=
db
.
prepare
(
"INSERT INTO foo VALUES(?, ?)"
);
for
(
var
i
=
0
;
i
<
count
;
i
++
)
{
...
...
@@ -24,5 +23,4 @@ db.serialize(function() {
}
stmt
.
finalize
();
db
.
run
(
"COMMIT TRANSACTION"
);
});
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