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.
Implements
Inherited Members
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
Type | Name | Description |
---|---|---|
string | schemaName |
CreateSchemaTask(string, string)
Declaration
public CreateSchemaTask(string schemaName, string authorizationUser)
Parameters
Type | Name | Description |
---|---|---|
string | schemaName | |
string | authorizationUser |
Properties
AuthorizationUser
Declaration
public string AuthorizationUser { get; set; }
Property Value
Type | Description |
---|---|
string |
ON
The formatted schema name
Declaration
public ObjectNameDescriptor ON { get; }
Property Value
Type | Description |
---|---|
ObjectNameDescriptor |
SchemaName
The name of the schema
Declaration
public string SchemaName { get; set; }
Property Value
Type | Description |
---|---|
string |
Sql
The sql that is used to create the schema.
Declaration
public string Sql { get; }
Property Value
Type | Description |
---|---|
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
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | The connection manager of the database you want to connect |
string | schemaName | 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
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | The connection manager of the database you want to connect |
string | schemaName | The name of the schema |
string | authorizationUser | 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
Type | Name | Description |
---|---|---|
string | schemaName | 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
Type | Name | Description |
---|---|---|
string | schemaName | The name of the schema |
string | authorizationUser | 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
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | The connection manager of the database you want to connect |
string | schemaName | 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
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | The connection manager of the database you want to connect |
string | schemaName | The name of the schema |
string | authorizationUser | 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
Type | Name | Description |
---|---|---|
string | schemaName | 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
Type | Name | Description |
---|---|---|
string | schemaName | The name of the schema |
string | authorizationUser | Database user which is authorized for the schema |