Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

data-api-local

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-api-local - npm Package Compare versions

Comparing version 0.0.1-alpha.0 to 0.0.2-alpha.2

CHANGELOG.md

36

package.json
{
"name": "data-api-local",
"version": "0.0.1-alpha.0",
"version": "0.0.2-alpha.2",
"description": "AWS Aurora Serverless Data API emulator for local development.",
"homepage": "https://github.com/marcgreenstock/data-api-local/tree/master/packages/data-api-local",
"repository": {
"type": "git",
"url": "https://github.com/marcgreenstock/data-api-local.git",
"directory": "packages/data-api-local"
},
"bugs": {
"url": "https://github.com/marcgreenstock/data-api-local/issues"
},
"keywords": [
"AWS Aurora Serverless Data API",
"Serverless",
"Plugin",
"Local",
"Offline",
"Postgres",
"PostgreSQL"
],
"main": "lib/index.js",

@@ -14,3 +32,3 @@ "types": "lib/index",

"compile": "tsc -p tsconfig.build.json",
"prepublish": "npm run build"
"prepare": "npm run build"
},

@@ -22,5 +40,4 @@ "license": "MIT",

"http-errors": "^1.7.3",
"uuid": "^3.3.3",
"yargs": "^15.0.2",
"yup": "^0.27.0"
"pg": "^7.14.0",
"uuid": "^3.3.3"
},

@@ -30,18 +47,11 @@ "devDependencies": {

"@types/http-errors": "^1.6.3",
"@types/mysql": "^2.15.8",
"@types/node": "^12.12.14",
"@types/pg": "^7.11.2",
"@types/uuid": "^3.4.6",
"@types/yup": "^0.26.26",
"aws-sdk": "^2.590.0",
"jest": "^24.9.0",
"mysql": "^2.17.1",
"pg": "^7.14.0",
"typescript": "^3.7.3"
},
"peerDependencies": {
"mysql": "^2.17.1",
"pg": "^7.14.0"
},
"gitHead": "55bc47c9ccecb75eac0d577a49585c7135751727"
"gitHead": "7dce20858b85849b5b6ba472f559a842e34ef3ba"
}

@@ -5,48 +5,47 @@ # Data API Local

## CLI
**Note:** Currently only supports PostgreSQL - MySQL is on the roadmap.
dataApiLocal mysql --host localhost --port 3336 --user marc --password foobar
## Example:
## Programatic usage
### PostgreSQL
```ts
import * as RDSDataService from 'aws-sdk/clients/rdsdataservice'
import { dataApiLocal } from './data-api-local'
DataAPILocal.dataApiLocal({
engine: 'postgres',
logger: console,
connection: {
host: 'localhost',
port: 3336,
user: 'marc',
password: 'foobar'
// assuming your in an async function
await dataApiLocal({
server: {
hostname: 'localhost',
port: 8080
},
host: {
port: 8080,
hostname: 'localhost'
database: {
engine: 'postgresql',
port: 54320,
user: 'test',
password: 'test'
}
})
```
### MySQL
```ts
import { dataApiLocal } from './data-api-local'
DataAPILocal.dataApiLocal({
engine: 'mysql',
logger: console,
connection: {
host: 'localhost',
port: 3336,
user: 'marc',
password: 'foobar'
},
host: {
port: 8080,
hostname: 'localhost'
const client = new RDSDataService({
endpoint: 'http://localhost:8080',
region: 'us-east-1',
// If you have an AWS profile or running this in a role, this isn't required
credentials: {
accessKeyId: 'SECRET_ID',
secretAccessKey: 'SECRET_KEY'
}
})
const result = await client.executeStatement({
sql: 'SELECT * FROM "users" WHERE id = :id',
parameters: [{
name: 'id',
value: {
longValue: 42
}
}],
database: 'example'
// secretArn and resourceArn are not used but are required for the AWS SDK
secretArn: 'arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy',
resourceArn: 'arn:aws:rds:us-east-1:123456789012:cluster:dummy'
}).promise()
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc