Skip to content

Commit

Permalink
Fixed quoting issue in connection.js
Browse files Browse the repository at this point in the history
Updated README.md
  • Loading branch information
Michael Anderson committed Jul 24, 2017
1 parent 554fc6d commit 1a86163
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Where the root node is the path to the parent of the entries you define as table
### Usage
#### MySQL Example
~~~~
var Database = require('database-js2');
var Database = require('database-js2').Connection;
(async function() {
let connection, statement, rows;
Expand All @@ -41,7 +41,7 @@ var Database = require('database-js2');

#### MS Access Example
~~~~
var Database = require('database-js2');
var Database = require('database-js2').Connection;
(async function() {
let connection, statement, rows;
Expand All @@ -62,7 +62,7 @@ var Database = require('database-js2');

#### MS Excel Example
~~~~
var Database = require('database-js2');
var Database = require('database-js2').Connection;
(async function() {
let connection, statement, rows;
Expand All @@ -83,7 +83,7 @@ var Database = require('database-js2');
#### Firebase Example
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).
~~~~
var Database = require('database-js2');
var Database = require('database-js2').Connection;
(async function() {
let connection, statement, rows;
Expand Down
1 change: 1 addition & 0 deletions lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function QuoteString(string) {
return string.toString();
}
string = string.toString();
string = string.replace(/\\/g, '\\\\');
string = string.replace('\x00', '\\x00');
string = string.replace('\n', '\\n');
string = string.replace('\r', '\\r');
Expand Down
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"adodb": "^1.0.0",
"database-js-adodb": "^1.0.0",
"database-js-firebase": "^1.0.0",
"database-js-ini": "git+https://github.com/mlaanderson/database-js-ini.git",
"database-js-mysql": "^1.0.0",
"firebase": "^4.1.3",
"mysql": "^2.13.0",
Expand Down
10 changes: 10 additions & 0 deletions test.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
scope=global

[database]
user=dbuser
password=dbpassword
database=use_this_database

[locations]
datadir=/var/lib/data
encoding=UTF-8

0 comments on commit 1a86163

Please sign in to comment.