CreateSchemaTask

Class CreateSchemaTask

Creates a schema. For MySql or MariaDb, use the CreateDatabaseTask instead. The Create method will throw an exception if the schema already exists. CreateIfNotExists will only create a schema if it doesn't exists.

Inheritance
CreateSchemaTask
Implements
Namespace: ETLBox.ControlFlow
Assembly: ETLBox.dll
Syntax
    public sealed class CreateSchemaTask : ControlFlowTask, ILoggableTask
Examples
CreateSchemaTask.Create("demo");
CreateSchemaTask.CreateIfNotExists("demo2");

Constructors

CreateSchemaTask()

Declaration
    public CreateSchemaTask()

CreateSchemaTask(string)

Declaration
    public CreateSchemaTask(string schemaName)
Parameters
TypeNameDescription
stringschemaName

CreateSchemaTask(string, string)

Declaration
    public CreateSchemaTask(string schemaName, string authorizationUser)
Parameters
TypeNameDescription
stringschemaName
stringauthorizationUser

Properties

AuthorizationUser

Declaration
    public string AuthorizationUser { get; set; }
Property Value
TypeDescription
string

ON

The formatted schema name

Declaration
    public ObjectNameDescriptor ON { get; }
Property Value
TypeDescription
ObjectNameDescriptor

SchemaName

The name of the schema

Declaration
    public string SchemaName { get; set; }
Property Value
TypeDescription
string

Sql

The sql that is used to create the schema.

Declaration
    public string Sql { get; }
Property Value
TypeDescription
string

Methods

Create()

Runs the sql that creates the schema. If the schema already exists, an Exception is thrown. Works only if the database does support schema (for MySql, use the CreateDatabaseTask instead)

Declaration
    public void Create()

Create(IConnectionManager, string)

Creates a schema. Throws an exception if the schema already exists. For MySql, use the CreateDatabaseTask instead.

Declaration
    public static void Create(IConnectionManager connectionManager, string schemaName)
Parameters
TypeNameDescription
IConnectionManagerconnectionManager

The connection manager of the database you want to connect

stringschemaName

The name of the schema

Create(IConnectionManager, string, string)

Creates a schema. Throws an exception if the schema already exists. For MySql, use the CreateDatabaseTask instead.

Declaration
    public static void Create(IConnectionManager connectionManager, string schemaName, string authorizationUser)
Parameters
TypeNameDescription
IConnectionManagerconnectionManager

The connection manager of the database you want to connect

stringschemaName

The name of the schema

stringauthorizationUser

Database user which is authorized for the schema

Create(string)

Creates a schema. Throws an exception if the schema already exists. For MySql, use the CreateDatabaseTask instead.

Declaration
    public static void Create(string schemaName)
Parameters
TypeNameDescription
stringschemaName

The name of the schema

Create(string, string)

Creates a schema. Throws an exception if the schema already exists. For MySql, use the CreateDatabaseTask instead.

Declaration
    public static void Create(string schemaName, string authorizationUser)
Parameters
TypeNameDescription
stringschemaName

The name of the schema

stringauthorizationUser

Database user which is authorized for the schema

CreateIfNotExists()

Runs the sql that creates the schema. Schema is only created if the schema doesn't exists. Works only if the database does support schema (for MySql, use the CreateDatabaseTask instead)

Declaration
    public void CreateIfNotExists()

CreateIfNotExists(IConnectionManager, string)

Creates a schema if the schema doesn't exists. For MySql, use the CreateDatabaseTask instead

Declaration
    public static void CreateIfNotExists(IConnectionManager connectionManager, string schemaName)
Parameters
TypeNameDescription
IConnectionManagerconnectionManager

The connection manager of the database you want to connect

stringschemaName

The name of the schema

CreateIfNotExists(IConnectionManager, string, string)

Creates a schema if the schema doesn't exists. For MySql, use the CreateDatabaseTask instead

Declaration
    public static void CreateIfNotExists(IConnectionManager connectionManager, string schemaName, string authorizationUser)
Parameters
TypeNameDescription
IConnectionManagerconnectionManager

The connection manager of the database you want to connect

stringschemaName

The name of the schema

stringauthorizationUser

Database user which is authorized for the schema

CreateIfNotExists(string)

Creates a schema if the schema doesn't exists. For MySql, use the CreateDatabaseTask instead.

Declaration
    public static void CreateIfNotExists(string schemaName)
Parameters
TypeNameDescription
stringschemaName

The name of the schema

CreateIfNotExists(string, string)

Creates a schema if the schema doesn't exists. For MySql, use the CreateDatabaseTask instead.

Declaration
    public static void CreateIfNotExists(string schemaName, string authorizationUser)
Parameters
TypeNameDescription
stringschemaName

The name of the schema

stringauthorizationUser

Database user which is authorized for the schema

Implements