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
d4c56d42
Commit
d4c56d42
authored
Aug 30, 2021
by
Richard Hansen
Committed by
Kewde
Oct 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run `npx eslint --fix .` to auto-fix lint issues
parent
8c23ffbb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
60 deletions
+60
-60
insert.js
benchmark/insert.js
+1
-1
ci.template.js
cloudformation/ci.template.js
+50
-50
prepare.test.js
test/prepare.test.js
+1
-1
createdb.js
test/support/createdb.js
+2
-2
helper.js
test/support/helper.js
+2
-2
unicode.test.js
test/unicode.test.js
+3
-3
upsert.test.js
test/upsert.test.js
+1
-1
No files found.
benchmark/insert.js
View file @
d4c56d42
...
...
@@ -8,7 +8,7 @@ exports.compare = {
var
db
=
new
sqlite3
.
Database
(
''
);
var
file
=
fs
.
readFileSync
(
'benchmark/insert-transaction.sql'
,
'utf8'
);
db
.
exec
(
file
);
db
.
close
(
finished
)
db
.
close
(
finished
)
;
},
'insert with transaction and two statements'
:
function
(
finished
)
{
...
...
cloudformation/ci.template.js
View file @
d4c56d42
var
cf
=
require
(
'@mapbox/cloudfriend'
);
var
package_json
=
require
(
'../package.json'
)
var
package_json
=
require
(
'../package.json'
)
;
module
.
exports
=
{
AWSTemplateFormatVersion
:
'2010-09-09'
,
Description
:
'user for publishing to s3://mapbox-node-binary/'
+
package_json
.
name
,
Resources
:
{
User
:
{
Type
:
'AWS::IAM::User'
,
Properties
:
{
Policies
:
[
{
PolicyName
:
'list'
,
PolicyDocument
:
{
Statement
:
[
{
Action
:
[
's3:ListBucket'
],
Effect
:
'Allow'
,
Resource
:
'arn:aws:s3:::mapbox-node-binary'
,
Condition
:
{
StringLike
:
{
"s3:prefix"
:
[
package_json
.
name
+
"/*"
]
AWSTemplateFormatVersion
:
'2010-09-09'
,
Description
:
'user for publishing to s3://mapbox-node-binary/'
+
package_json
.
name
,
Resources
:
{
User
:
{
Type
:
'AWS::IAM::User'
,
Properties
:
{
Policies
:
[
{
PolicyName
:
'list'
,
PolicyDocument
:
{
Statement
:
[
{
Action
:
[
's3:ListBucket'
],
Effect
:
'Allow'
,
Resource
:
'arn:aws:s3:::mapbox-node-binary'
,
Condition
:
{
StringLike
:
{
"s3:prefix"
:
[
package_json
.
name
+
"/*"
]
}
}
}
]
}
},
{
PolicyName
:
'publish'
,
PolicyDocument
:
{
Statement
:
[
{
Action
:
[
's3:DeleteObject'
,
's3:GetObject'
,
's3:GetObjectAcl'
,
's3:PutObject'
,
's3:PutObjectAcl'
],
Effect
:
'Allow'
,
Resource
:
'arn:aws:s3:::mapbox-node-binary/'
+
package_json
.
name
+
'/*'
}
]
}
}
}
}
]
]
}
},
{
PolicyName
:
'publish'
,
PolicyDocument
:
{
Statement
:
[
{
Action
:
[
's3:DeleteObject'
,
's3:GetObject'
,
's3:GetObjectAcl'
,
's3:PutObject'
,
's3:PutObjectAcl'
],
Effect
:
'Allow'
,
Resource
:
'arn:aws:s3:::mapbox-node-binary/'
+
package_json
.
name
+
'/*'
}
]
},
AccessKey
:
{
Type
:
'AWS::IAM::AccessKey'
,
Properties
:
{
UserName
:
cf
.
ref
(
'User'
)
}
}
]
}
}
},
AccessKey
:
{
Type
:
'AWS::IAM::AccessKey'
,
Properties
:
{
UserName
:
cf
.
ref
(
'User'
)
}
Outputs
:
{
AccessKeyId
:
{
Value
:
cf
.
ref
(
'AccessKey'
)
},
SecretAccessKey
:
{
Value
:
cf
.
getAtt
(
'AccessKey'
,
'SecretAccessKey'
)
}
}
},
Outputs
:
{
AccessKeyId
:
{
Value
:
cf
.
ref
(
'AccessKey'
)
},
SecretAccessKey
:
{
Value
:
cf
.
getAtt
(
'AccessKey'
,
'SecretAccessKey'
)
}
}
};
test/prepare.test.js
View file @
d4c56d42
...
...
@@ -270,7 +270,7 @@ describe('prepare', function() {
before
(
function
(
done
)
{
db
=
new
sqlite3
.
Database
(
'test/support/prepare.db'
,
sqlite3
.
OPEN_READONLY
,
done
);
});
it
(
'should retrieve particular rows'
,
function
(
done
)
{
db
.
prepare
(
"SELECT txt, num, flt, blb FROM foo WHERE num > 5000"
)
db
.
prepare
(
"SELECT txt, num, flt, blb FROM foo WHERE num > 5000"
)
.
all
(
function
(
err
,
rows
)
{
if
(
err
)
throw
err
;
assert
.
ok
(
rows
.
length
===
0
);
...
...
test/support/createdb.js
View file @
d4c56d42
...
...
@@ -16,7 +16,7 @@ function createdb(callback) {
str
+=
chars
[
Math
.
floor
(
Math
.
random
()
*
chars
.
length
)];
}
return
str
;
}
;
}
if
(
existsSync
(
db_path
))
{
...
...
@@ -38,7 +38,7 @@ function createdb(callback) {
});
});
}
}
;
}
if
(
require
.
main
===
module
)
{
createdb
();
...
...
test/support/helper.js
View file @
d4c56d42
...
...
@@ -15,8 +15,8 @@ exports.deleteFile = function(name) {
exports
.
ensureExists
=
function
(
name
,
cb
)
{
if
(
!
pathExists
(
name
))
{
fs
.
mkdirSync
(
name
);
}
;
}
}
}
;
assert
.
fileDoesNotExist
=
function
(
name
)
{
try
{
...
...
test/unicode.test.js
View file @
d4c56d42
...
...
@@ -48,7 +48,7 @@ describe('unicode', function() {
}
else
if
(
first
<
0xe0
)
{
return
String
.
fromCharCode
((
first
&
0x1f
)
<<
0x6
|
random_choice
(
trailing_values
)
&
0x3f
);
}
else
if
(
first
==
0xe0
)
{
return
String
.
fromCharCode
(((
first
&
0xf
)
<<
0xc
)
|
((
random_choice
(
subranges
[
0
])
&
0x3f
)
<<
6
)
|
random_choice
(
trailing_values
)
&
0x3f
);
return
String
.
fromCharCode
(((
first
&
0xf
)
<<
0xc
)
|
((
random_choice
(
subranges
[
0
])
&
0x3f
)
<<
6
)
|
random_choice
(
trailing_values
)
&
0x3f
);
}
else
if
(
first
==
0xed
)
{
return
String
.
fromCharCode
(((
first
&
0xf
)
<<
0xc
)
|
((
random_choice
(
subranges
[
1
])
&
0x3f
)
<<
6
)
|
random_choice
(
trailing_values
)
&
0x3f
);
}
else
if
(
first
<
0xf0
)
{
...
...
@@ -58,7 +58,7 @@ describe('unicode', function() {
function
randomString
()
{
var
str
=
''
,
i
;
i
;
for
(
i
=
Math
.
random
()
*
300
;
i
>
0
;
i
--
)
{
str
+=
random_utf8
();
...
...
@@ -68,7 +68,7 @@ describe('unicode', function() {
}
// Generate random data.
// Generate random data.
var
data
=
[];
var
length
=
Math
.
floor
(
Math
.
random
()
*
1000
)
+
200
;
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
...
...
test/upsert.test.js
View file @
d4c56d42
...
...
@@ -20,7 +20,7 @@ describe('query properties', function() {
if
(
err
)
throw
err
;
assert
.
equal
(
row
.
count
,
3
);
// equals 3
});
})
})
;
});
db
.
wait
(
done
);
});
...
...
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