Skip to content

Commit 1a86163

Browse files
author
Michael Anderson
committed
Fixed quoting issue in connection.js
Updated README.md
1 parent 554fc6d commit 1a86163

File tree

5 files changed

+26
-4
lines changed

5 files changed

+26
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Where the root node is the path to the parent of the entries you define as table
2121
### Usage
2222
#### MySQL Example
2323
~~~~
24-
var Database = require('database-js2');
24+
var Database = require('database-js2').Connection;
2525
2626
(async function() {
2727
let connection, statement, rows;
@@ -41,7 +41,7 @@ var Database = require('database-js2');
4141

4242
#### MS Access Example
4343
~~~~
44-
var Database = require('database-js2');
44+
var Database = require('database-js2').Connection;
4545
4646
(async function() {
4747
let connection, statement, rows;
@@ -62,7 +62,7 @@ var Database = require('database-js2');
6262

6363
#### MS Excel Example
6464
~~~~
65-
var Database = require('database-js2');
65+
var Database = require('database-js2').Connection;
6666
6767
(async function() {
6868
let connection, statement, rows;
@@ -83,7 +83,7 @@ var Database = require('database-js2');
8383
#### Firebase Example
8484
The username and password is not the Firebase account holder's email and password. These are the login credentials for an authorized user of the Firebase data. Currently the wrapper only supports [email sign in methods](https://firebase.google.com/docs/auth/web/password-auth).
8585
~~~~
86-
var Database = require('database-js2');
86+
var Database = require('database-js2').Connection;
8787
8888
(async function() {
8989
let connection, statement, rows;

lib/connection.js

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function QuoteString(string) {
2626
return string.toString();
2727
}
2828
string = string.toString();
29+
string = string.replace(/\\/g, '\\\\');
2930
string = string.replace('\x00', '\\x00');
3031
string = string.replace('\n', '\\n');
3132
string = string.replace('\r', '\\r');

package-lock.json

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

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"adodb": "^1.0.0",
2424
"database-js-adodb": "^1.0.0",
2525
"database-js-firebase": "^1.0.0",
26+
"database-js-ini": "git+https://github.com/mlaanderson/database-js-ini.git",
2627
"database-js-mysql": "^1.0.0",
2728
"firebase": "^4.1.3",
2829
"mysql": "^2.13.0",

test.ini

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
scope=global
2+
3+
[database]
4+
user=dbuser
5+
password=dbpassword
6+
database=use_this_database
7+
8+
[locations]
9+
datadir=/var/lib/data
10+
encoding=UTF-8

0 commit comments

Comments
 (0)