Skip to content

Commit 0090bb5

Browse files
Mike Kari AndersonMike Kari Anderson
Mike Kari Anderson
authored and
Mike Kari Anderson
committed
Moved SQLite example into examples directory
1 parent aed5037 commit 0090bb5

File tree

5 files changed

+112
-0
lines changed

5 files changed

+112
-0
lines changed

examples/sqlite/.gitignore

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (http://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# Typescript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+

examples/sqlite/index.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var Database = require('database-js2').Connection;
2+
3+
(async function main(){
4+
let connection = new Database("database-js-sqlite:///test.sqlite");
5+
let statement, results;
6+
7+
try {
8+
statement = await connection.prepareStatement("SELECT * FROM states WHERE State = ?");
9+
results = await statement.query('South Dakota');
10+
console.log(results);
11+
} catch (err) {
12+
console.log(err);
13+
} finally {
14+
connection.close();
15+
}
16+
})();

examples/sqlite/package-lock.json

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/sqlite/package.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "sqlite",
3+
"version": "1.0.0",
4+
"description": "SQLite example for database-js",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "node index.js"
8+
},
9+
"author": "Michael Anderson",
10+
"license": "MIT",
11+
"dependencies": {
12+
"database-js-sqlite": "^1.0.3",
13+
"database-js2": "^0.1.5"
14+
}
15+
}
File renamed without changes.

0 commit comments

Comments
 (0)