planetscale-node
Advanced tools
Comparing version 0.0.2 to 0.1.0
@@ -12,4 +12,7 @@ export declare class PSDB { | ||
query(data: any, params: any): Promise<any>; | ||
execute(sql: string, values: any | any[] | { | ||
[param: string]: any; | ||
}): Promise<any>; | ||
private createConnection; | ||
private getCSR; | ||
} |
@@ -25,2 +25,8 @@ "use strict"; | ||
} | ||
async execute(sql, values) { | ||
if (!this._connection) { | ||
this._connection = await this.createConnection(); | ||
} | ||
return this._connection.promise().execute(sql, values); | ||
} | ||
async createConnection() { | ||
@@ -27,0 +33,0 @@ const keys = forge.pki.rsa.generateKeyPair(2048); |
{ | ||
"name": "planetscale-node", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"description": "PlanetScale Database Client", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
# planetscale-node | ||
This is a very basic (v0.0.1) JavaScript client for connecting to PlanetScale. | ||
This is a pre-release JavaScript client for connecting to PlanetScale. | ||
@@ -39,3 +39,3 @@ ## Installation | ||
```javascript | ||
const {PDSB} = require('planetscale-node') | ||
const { PDSB } = require('planetscale-node') | ||
@@ -50,1 +50,15 @@ async function main() { | ||
``` | ||
### Using prepared statements | ||
```javascript | ||
const { PDSB } = require('planetscale-node') | ||
async function main() { | ||
const conn = new PSDB('main') | ||
const [rows, fields] = await conn.execute('select * from reminders where id > ?', [10]) | ||
console.log(rows, fields) | ||
} | ||
main() | ||
``` |
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
18482
5
111
63
2
1