Comparing version 1.0.0 to 1.1.0
@@ -37,2 +37,3 @@ 'use strict'; | ||
const TIMESTAMP_OID = 1114; | ||
const POINT_OID = 600; | ||
@@ -51,2 +52,6 @@ _pg.types.setTypeParser(INT8_OID, value => { | ||
_pg.types.setTypeParser(POINT_OID, value => { | ||
return value === null ? value : (0, _utilities.getCoordinatesFromPostgisHex)(value); | ||
}); | ||
const log = _Logger2.default.child({ | ||
@@ -53,0 +58,0 @@ namespace: 'slonik' |
@@ -7,2 +7,11 @@ 'use strict'; | ||
var _getCoordinatesFromPostgisHex = require('./getCoordinatesFromPostgisHex'); | ||
Object.defineProperty(exports, 'getCoordinatesFromPostgisHex', { | ||
enumerable: true, | ||
get: function () { | ||
return _interopRequireDefault(_getCoordinatesFromPostgisHex).default; | ||
} | ||
}); | ||
var _mapTaggedTemplateLiteralInvocation = require('./mapTaggedTemplateLiteralInvocation'); | ||
@@ -9,0 +18,0 @@ |
@@ -1,76 +0,1 @@ | ||
{ | ||
"author": { | ||
"email": "gajus@gajus.com", | ||
"name": "Gajus Kuizinas", | ||
"url": "http://gajus.com" | ||
}, | ||
"ava": { | ||
"babel": "inherit", | ||
"require": [ | ||
"babel-register" | ||
] | ||
}, | ||
"dependencies": { | ||
"ajv": "^5.3.0", | ||
"array-flatten": "^2.1.1", | ||
"es6-error": "^4.0.2", | ||
"pg": "^7.4.0", | ||
"pg-connection-string": "^2.0.0", | ||
"pretty-hrtime": "^1.0.3", | ||
"roarr": "^2.0.2" | ||
}, | ||
"description": "A PostgreSQL client with strict types and assertions.", | ||
"devDependencies": { | ||
"ava": "^0.23.0", | ||
"babel-cli": "^6.26.0", | ||
"babel-plugin-istanbul": "^4.1.5", | ||
"babel-plugin-transform-flow-strip-types": "^6.22.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-register": "^6.26.0", | ||
"coveralls": "^3.0.0", | ||
"eslint": "^4.10.0", | ||
"eslint-config-canonical": "^9.3.1", | ||
"flow-bin": "^0.58.0", | ||
"flow-copy-source": "^1.2.1", | ||
"husky": "^0.14.3", | ||
"nyc": "^11.3.0", | ||
"semantic-release": "^8.2.0", | ||
"sinon": "^4.1.2" | ||
}, | ||
"engines": { | ||
"node": ">=8.0" | ||
}, | ||
"keywords": [ | ||
"postgresql", | ||
"promise", | ||
"types" | ||
], | ||
"license": "BSD-3-Clause", | ||
"main": "./dist/index.js", | ||
"name": "slonik", | ||
"nyc": { | ||
"include": [ | ||
"src/**/*.js" | ||
], | ||
"instrument": false, | ||
"reporter": [ | ||
"text-lcov" | ||
], | ||
"require": [ | ||
"babel-register" | ||
], | ||
"sourceMap": false | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/gajus/slonik" | ||
}, | ||
"scripts": { | ||
"build": "rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist", | ||
"lint": "eslint ./src ./test && flow", | ||
"precommit": "npm run lint && npm run test", | ||
"test": "ava --verbose" | ||
}, | ||
"version": "1.0.0" | ||
} | ||
{"author":{"email":"gajus@gajus.com","name":"Gajus Kuizinas","url":"http://gajus.com"},"ava":{"babel":"inherit","require":["babel-register"]},"dependencies":{"ajv":"^5.3.0","array-flatten":"^2.1.1","es6-error":"^4.0.2","pg":"^7.4.0","pg-connection-string":"^2.0.0","pretty-hrtime":"^1.0.3","roarr":"^2.0.2","wkx":"^0.4.2"},"description":"A PostgreSQL client with strict types and assertions.","devDependencies":{"ava":"^0.23.0","babel-cli":"^6.26.0","babel-plugin-istanbul":"^4.1.5","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-env":"^1.6.1","babel-register":"^6.26.0","coveralls":"^3.0.0","eslint":"^4.10.0","eslint-config-canonical":"^9.3.1","flow-bin":"^0.58.0","flow-copy-source":"^1.2.1","husky":"^0.14.3","nyc":"^11.3.0","semantic-release":"^8.2.0","sinon":"^4.1.2"},"engines":{"node":">=8.0"},"keywords":["postgresql","promise","types"],"license":"BSD-3-Clause","main":"./dist/index.js","name":"slonik","nyc":{"include":["src/**/*.js"],"instrument":false,"reporter":["text-lcov"],"require":["babel-register"],"sourceMap":false},"repository":{"type":"git","url":"https://github.com/gajus/slonik"},"scripts":{"build":"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist","lint":"eslint ./src ./test && flow","precommit":"npm run lint && npm run test","test":"ava --verbose"},"version":"1.1.0"} |
@@ -12,2 +12,3 @@ # Slonik | ||
* [Usage](#usage) | ||
* [Non-standard behaviour](#non-standard-behaviour) | ||
* [Conventions](#conventions) | ||
@@ -59,2 +60,7 @@ * [No multiline values](#no-multiline-values) | ||
## Non-standard behaviour | ||
* `timestamp` and `timestamp with time zone` returns UNIX timestamp in milliseconds. | ||
* `point` returns an object `{x,y}`. | ||
## Conventions | ||
@@ -61,0 +67,0 @@ |
@@ -16,2 +16,3 @@ // @flow | ||
import { | ||
getCoordinatesFromPostgisHex, | ||
mapTaggedTemplateLiteralInvocation, | ||
@@ -59,2 +60,3 @@ normalizeAnonymousValuePlaceholders, | ||
const TIMESTAMP_OID = 1114; | ||
const POINT_OID = 600; | ||
@@ -73,2 +75,6 @@ types.setTypeParser(INT8_OID, (value) => { | ||
types.setTypeParser(POINT_OID, (value) => { | ||
return value === null ? value : getCoordinatesFromPostgisHex(value); | ||
}); | ||
const log = Logger.child({ | ||
@@ -75,0 +81,0 @@ namespace: 'slonik' |
@@ -85,4 +85,9 @@ // @flow | ||
type QueryPrimitiveValueType = string | number | null; | ||
export type PointType = {| | ||
+x: number, | ||
+y: number | ||
|}; | ||
type QueryPrimitiveValueType = string | number | null | PointType; | ||
export type AnonymouseValuePlaceholderValueType = | ||
@@ -89,0 +94,0 @@ |
// @flow | ||
export {default as getCoordinatesFromPostgisHex} from './getCoordinatesFromPostgisHex'; | ||
export {default as mapTaggedTemplateLiteralInvocation} from './mapTaggedTemplateLiteralInvocation'; | ||
@@ -4,0 +5,0 @@ export {default as normalizeAnonymousValuePlaceholders} from './normalizeAnonymousValuePlaceholders'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
122632
43
1267
541
8
+ Addedwkx@^0.4.2
+ Added@types/node@22.7.4(transitive)
+ Addedundici-types@6.19.8(transitive)
+ Addedwkx@0.4.8(transitive)