You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
8
8
> Wrapper for multiple databases with a JDBC-like connection
9
9
10
-
Database-js implements a common, promise-based interface for SQL database access. Inspired by Java, it uses connection strings to identify the database driver. Wrappers around native database drivers provide a unified interface to handle databases. Thus, you don't need to modify your code (except the connection string) to change your database! 😉
10
+
Database-js implements a common, promise-based interface for SQL database access. Inspired by JDBC, it uses connection strings to identify the database driver. Wrappers around native database drivers provide a unified interface to handle databases. Thus, you can change the target database by modifying the connection string. 😉
11
11
12
12
Database-js has built-in prepared statements, even if the underlying driver does not support them. It is built on Promises, so it works well with ES7 async code.
13
13
@@ -36,7 +36,8 @@ npm install database-js
36
36
|[Firebase](//github.com/mlaanderson/database-js-firebase)||`npm i database-js-firebase`|
37
37
|[INI files](//github.com/mlaanderson/database-js-ini)||`npm i database-js-ini`|
38
38
|[JSON files](//github.com/thiagodp/database-js-json)||`npm i database-js-json`|
39
-
|[MySQL](//github.com/mlaanderson/database-js-mysql)||`npm i database-js-mysql`|
39
+
|[MySQL](//github.com/mlaanderson/database-js-mysql)| prior to MySQL v8 |`npm i database-js-mysql`|
40
+
|[MySQL2](//github.com/esteban-serfe/database-js-mysql2/)| MySQL v8+ |`npm i database-js-mysql2`|
40
41
|[MS SQL Server](https://github.com/thiagodp/database-js-mssql)||`npm i database-js-mssql`|
41
42
|[PostgreSQL](//github.com/mlaanderson/database-js-postgres)||`npm i database-js-postgres`|
42
43
|[SQLite](//github.com/mlaanderson/database-js-sqlite)||`npm i database-js-sqlite`|
@@ -45,6 +46,8 @@ npm install database-js
45
46
46
47
## Usage
47
48
49
+
Usage _without_ async/await:
50
+
48
51
```javascript
49
52
var Connection =require('database-js').Connection;
50
53
@@ -84,7 +87,8 @@ conn.close()
84
87
85
88
### Async / await
86
89
87
-
Because **database-js** is built on Promises, it works very well with [async/await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/async_function). Compare the following code to the code from above. They accomplish the same thing.
0 commit comments