forked from npgsql/npgsql
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPostgresArrayType.cs
More file actions
34 lines (30 loc) · 1.17 KB
/
PostgresArrayType.cs
File metadata and controls
34 lines (30 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
namespace Npgsql.PostgresTypes;
/// <summary>
/// Represents a PostgreSQL array data type, which can hold several multiple values in a single column.
/// </summary>
/// <remarks>
/// See https://www.postgresql.org/docs/current/static/arrays.html.
/// </remarks>
public class PostgresArrayType : PostgresType
{
/// <summary>
/// The PostgreSQL data type of the element contained within this array.
/// </summary>
public PostgresType Element { get; }
/// <summary>
/// Constructs a representation of a PostgreSQL array data type.
/// </summary>
protected internal PostgresArrayType(string ns, string name, uint oid, PostgresType elementPostgresType)
: base(ns, name, oid)
{
Element = elementPostgresType;
Element.Array = this;
}
// PostgreSQL array types have an underscore-prefixed name (_text), but we
// want to return the public text[] instead
/// <inheritdoc/>
internal override string GetPartialNameWithFacets(int typeModifier)
=> Element.GetPartialNameWithFacets(typeModifier) + "[]";
internal override PostgresFacets GetFacets(int typeModifier)
=> Element.GetFacets(typeModifier);
}