Skip to content

PgSchemaAttribute

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Places a class’s generated functions in a fixed PostgreSQL schema, creating an extension-owned schema by default. Nested classes inherit the nearest declaration; a function’s Schema option overrides it.

[AttributeUsage(AttributeTargets.Class, Inherited = false)]
public sealed class PgSchemaAttribute : Attribute

Declares the schema’s exact identifier, quoted by the SQL generator.

Inheritance: object, Attribute

Places a class’s generated functions in a fixed PostgreSQL schema, creating an extension-owned schema by default. Nested classes inherit the nearest declaration; a function’s Schema option overrides it.

public PgSchemaAttribute(string name)

Parameters:

name — string

The nonempty schema name, at most 63 UTF-8 bytes.

Declares the schema’s exact identifier, quoted by the SQL generator.

Gets or sets whether installation creates and owns the schema. Set false to require an existing schema without adopting it.

public bool Create { get; set; }

Value: bool

Gets or sets a dependency identifier for this schema declaration. Multiple classes describing the same schema may expose different identifiers for that single schema.

public string? Id { get; set; }

Value: string

Gets the SQL schema identifier.

public string Name { get; }

Value: string

Gets or sets identifiers of SQL blocks or generated declarations that must precede this schema.

public string[] Requires { get; set; }

Value: string[]