Comments (6)
It’s unlikely to be a performance issue, but I’m not sure why types.arrayParser.create
exists at all. (Backwards compatibility?) postgresArray.parse(val, parseInt)
with a dependency on postgres-array
is fine.
from node-pg-types.
Not sure, it was exported in the "@types/pg": "^7.4.10"
so I assumed it was the way to do it (and I had to do some digging). Somehow, creating a function per value parsing felt off, but I agree hard to know if it is a performance issue until it is.
But great, I will use the postgresArray.parse
, feels more common.
On a related note, would be great if the pg
module could export postgresArray
and that the parse
be in the @types/pg
. Right now there is no @types/postgres-array
, not deal breaker, just a little cumbersome to use.
Thanks for the fast response, and for this high quality lib. node-postgres's quality has been critical in our decision to move our "big app" dev to node from Java.
from node-pg-types.
I've refactored this library a bit over time. Pulled out some of the larger concepts (e.g. arrays, dates) into their own module. But generally kept the API the same.
You should feel free to depend on postgres-array, that's what I was hoping for when publishing it separately (easier to build custom behavior).
As for performance, I'm hesitant to start picking at anything without benchmarks. You're probably right in this case but it's hard to say what the magnitude of impact would be. I'm open to working on that across the node/pg toolchain at some point.
from node-pg-types.
Cool thanks. If you want I and contribute the @types/postgres-array
to npm or even better, do a pull request on postgres-array
with the type definition. Does not change anything for non typescript users, but removes quite a bit of pain for TS user.
from node-pg-types.
do a pull request on postgres-array with the type definition
Please do!
from node-pg-types.
@bendrucker Just did the pull request, sorry for the delay.
from node-pg-types.
Related Issues (20)
- Parser not working for bigint values HOT 3
- Can I customize type parsing per query? HOT 3
- please throw when oid is nullish HOT 1
- Reuse postgres-bytea HOT 6
- Releasing the latest changes HOT 4
- parsing postgres box type? HOT 2
- should handle null values HOT 1
- overriding a type parser HOT 1
- Does full text search with to_tsquery work ? HOT 1
- Is the Date parsing fix in the current pg release? HOT 1
- How to import pg-types using ES6 syntax? HOT 2
- Not able to use with modules HOT 1
- +num over parseInt(num, 10) HOT 1
- Changelog with breaking changes? HOT 1
- Add support for parsing RECORD types (OIDs 2249 and 2287) HOT 3
- Can this package be used in the browser? HOT 2
- Tracking down geometry oids HOT 3
- Readme. What number represents what type. HOT 2
- types.setTypeParser(types.builtins.DATE) does not work
- Numeric values are parsed as strings but arrays of numerics are parsed as number arrays HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-pg-types.