Comments (7)
We should indeed provide a bit of documentation.
At the ADO level, Npgsql supports all the array capabilities of PostgreSQL itself, so in general what you find in the PostgreSQL docs is supported. Note that PostgreSQL does not support arrays of arrays, but does support multi-dimensional arrays (you can see some examples in the docs). You can use either .NET arrays or generic Lists to map to PostgreSQL arrays.
Note, however, that the EF Core provider's multi-dimensional arrays support is very limited - basically stick to one-dimensional arrays.
from doc.
Note that PostgreSQL does not support arrays of arrays, but does support multi-dimensional arrays (you can see some examples in the docs). You can use either .NET arrays or generic Lists to map to PostgreSQL arrays.
@roji Hey thanks for your answer! Much appreciated!
One thing though, when you're saying:
Note that PostgreSQL does not support arrays of arrays, but does support multi-dimensional arrays (you can see some examples in the docs)
How does it work in npgsql to benefit from the multidimensional array support then?
NpgsqlDbType.Array | NpgsqlDbType.Array | NpgsqlDbType.SmallInt
from doc.
Nope, just NpgsqlDbType.Array | NpgsqlDbType.SmallInt
. That corresponds to an array of any dimensions in PostgreSQL.
from doc.
Nope, just
NpgsqlDbType.Array | NpgsqlDbType.SmallInt
. That corresponds to an array of any dimensions in PostgreSQL.
@roji Alright, that's a little bit counterintuitive... just to make this super-duper clear, with NpgsqlDbType.Array | NpgsqlDbType.SmallInt
, you can pass resp. int[]
, int [,]
, int[,,]
, int[,,,]
and even bigger dimensions?
from doc.
Yes. I know it may seem a bit odd, but the way PostgreSQL handles type arrays, all arrays of a given element type - regardless of dimension - are of a single type; this is why a single NpgsqlDbType value maps to them all.
from doc.
BTW regardless of PostgreSQL, NpgsqlDbType.Array | NpgsqlDbType.Array | NpgsqlDbType.SmallInt
doesn't really make any sense in C# - ORing something will itself doesn't produce any useful effect.
from doc.
@roji alrite alrite, thanks! It makes sense now.
from doc.
Related Issues (20)
- Document Npgsql.DependencyInjection
- Document that logging support is removed in v7 HOT 1
- Full text query parse issue HOT 1
- TCP Keep Alive time is in s, the documentation say ms HOT 3
- Null value types using the positional parameter API - guidance HOT 4
- Enum docs should be updated given deprecation of GlobalTypeMapper
- Update documentation for using NetTopologySuite/NodaTime with NpgsqlDataSource HOT 2
- Improve FAQ page
- Small error on collations docs HOT 1
- Add NpgsqlCidr type to v8 Release Notes HOT 3
- Document unmapped composite support
- Document ExecuteScalar returning null for void where it returned DBNull
- Add Note about unsupported Regex options HOT 2
- Proposal: Migrate to mkdocs HOT 2
- Release notes for Net8 (Breaking changes, JSON POCO) doesn't link to correct documentation pages HOT 1
- Basic Usage NpgsqlCommand ExecuteReaderAsync Return Value Is Wrong HOT 2
- Should remove IntegratedSecurity from the doc HOT 1
- I have an optimization suggestion regarding the Npgsql website. HOT 1
- Undocumented breaking change of stringValue.Contains(value) in v8 HOT 1
- Nullable value types in 8.0 on Release Notes vs Strongly Typed Parameters on Basic Usage
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 doc.