Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request discussion: Adding PostgresArray type #14

Open
kkieffer opened this issue Sep 28, 2019 · 2 comments
Open

Pull request discussion: Adding PostgresArray type #14

kkieffer opened this issue Sep 28, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@kkieffer
Copy link

I've created an extension to the library in my own code which may be useful if you'd consider a pull request. One of my data types is an array of SQL values, which there is currently no support for. The code linked here would add that type:

https://gist.github.com/kkieffer/0adadaaa351871d59d08a95d40f67cc3

The user can create an optionalArray and pull the values from it like this:

let postgresArrayValues : [PostgresValue] = try columns[8].optionalArray()?.arrayValues

Then for each value, they can extract the desired type.

The postgresValue for PostgresArray provides a raw value like this:

{"value1","value2","value3"}

@pitfield pitfield added the enhancement New feature or request label Oct 3, 2019
@pitfield
Copy link
Member

pitfield commented Oct 3, 2019

Thanks for this suggestion. I need to learn more about arrays in Postgres, and will then reply with my thoughts on this.

@vaibhav-kaushal
Copy link

@pitfield Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants