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
System.Object
CreateSchemaTask
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ETLBox.ControlFlow.Tasks
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
System.StringschemaName

CreateSchemaTask(String, String)

Declaration
    public CreateSchemaTask(string schemaName, string authorizationUser)
Parameters
TypeNameDescription
System.StringschemaName
System.StringauthorizationUser

Properties

AuthorizationUser

Declaration
    public string AuthorizationUser { get; set; }
Property Value
TypeDescription
System.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
System.String

Sql

The sql that is used to create the schema.

Declaration
    public string Sql { get; }
Property Value
TypeDescription
System.String

TaskName

A name to identify the task or component. Every component or task comes with a default name that can be overwritten.

Declaration
    public override string TaskName { get; set; }
Property Value
TypeDescription
System.String
Overrides

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

System.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

System.StringschemaName

The name of the schema

System.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
System.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
System.StringschemaName

The name of the schema

System.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

System.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

System.StringschemaName

The name of the schema

System.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
System.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
System.StringschemaName

The name of the schema

System.StringauthorizationUser

Database user which is authorized for the schema

Implements