data-api-local
Advanced tools
Comparing version 0.0.1-alpha.0 to 0.0.2-alpha.2
{ | ||
"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() | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
53922
5
9
22
1
1
0
51
+ Addedpg@^7.14.0
- Removedyargs@^15.0.2
- Removedyup@^0.27.0
- Removed@babel/runtime@7.26.0(transitive)
- Removedansi-regex@5.0.1(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedbignumber.js@9.0.0(transitive)
- Removedcamelcase@5.3.1(transitive)
- Removedcliui@6.0.0(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removedemoji-regex@8.0.0(transitive)
- Removedfind-up@4.1.0(transitive)
- Removedfn-name@2.0.1(transitive)
- Removedget-caller-file@2.0.5(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedisarray@1.0.0(transitive)
- Removedlocate-path@5.0.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedmysql@2.18.1(transitive)
- Removedp-limit@2.3.0(transitive)
- Removedp-locate@4.1.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedpath-exists@4.0.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedproperty-expr@1.5.1(transitive)
- Removedreadable-stream@2.3.7(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedrequire-directory@2.1.1(transitive)
- Removedrequire-main-filename@2.0.0(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedsqlstring@2.3.1(transitive)
- Removedstring-width@4.2.3(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedstrip-ansi@6.0.1(transitive)
- Removedsynchronous-promise@2.0.17(transitive)
- Removedtoposort@2.0.2(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwhich-module@2.0.1(transitive)
- Removedwrap-ansi@6.2.0(transitive)
- Removedy18n@4.0.3(transitive)
- Removedyargs@15.4.1(transitive)
- Removedyargs-parser@18.1.3(transitive)
- Removedyup@0.27.0(transitive)