Search Results for

    Show / Hide Table of Contents

    Class AdbMySqlClientTableInformationService

    An optional service that uses the MySql.Data.MySqlClient ADO.NET provider that manipulates table identifiers and provides information about table-like objects, such as which ones exists and what their type is (table, view, etc), and which columns are present. This assists with writing provider-independent database code, and is available as TableInformation. Also see HasTableInformationService, AdbMySqlClientTableCommandService, AdbMySqlClientDataSourceInformationService, AdbConnection and AdbProvider.

    Derive from this class (or from a base or descendant class) to customize the information for either the same .NET provider, or for a different but similar .NET provider.

    Inheritance
    Object
    AdbGenericTableInformationService
    AdbMySqlClientTableInformationService
    Implements
    IAdbTableInformationService
    Inherited Members
    AdbGenericTableInformationService.ComposeTableIdentifierParts(String, String, String)
    AdbGenericTableInformationService.Connection
    Namespace: actionETL.Adb.MySqlClientExternal
    Assembly: actionETL.dll
    Syntax
    public class AdbMySqlClientTableInformationService : AdbGenericTableInformationService, IAdbTableInformationService

    Methods

    CreateTableIdentifier(String)

    Creates an identifier for a table-like database object from a composite name, i.e. it splits a potentially delimited table name into its constituent parts, i.e. database or catalog name, schema or owner name, and table name.

    The MySqlClient provider puts the database/schema (or an empty string if not specified) in the SchemaName properties. CatalogName properties will contain null.

    Declaration
    public override IAdbTableIdentifier CreateTableIdentifier(string compositeTableName)
    Parameters
    Type Name Description
    String compositeTableName

    Name of the table, potentially including database or catalog name, and schema or owner name.

    The string must be formatted according to the requirements of the data source, i.e. use the appropriate quoting characters and delimiters, in the appropriate order.

    Returns
    Type Description
    IAdbTableIdentifier

    A table identifier.

    Overrides
    AdbGenericTableInformationService.CreateTableIdentifier(String)
    Exceptions
    Type Condition
    ArgumentException

    compositeTableName cannot be null or only whitespace.

    Get()

    Gets a function that returns a new instance of AdbMySqlClientTableInformationService on each invocation, which is used when instantiating a new AdbProvider for accessing a MySQL™ or MariaDB™ data source.

    Declaration
    public static Func<IAdbConnection, IAdbTableInformationService> Get()
    Returns
    Type Description
    Func<IAdbConnection, IAdbTableInformationService>

    GetTableColumnsAsync(IAdbTableIdentifier)

    Gets information (name, data type etc.) about all columns in a table-like database object.

    With a MySQL™ or MariaDB™ data source, this method and workers using this method supports regular tables and views (specifically all object types included in the GetSchema(String, String[]) "COLUMNS" collection). Note that temporary tables are currently not supported by this method.

    Note that it does not include objects that do not themselves have columns, e.g. stored procedures.

    Note that this method does not log errors. Instead the caller should normally log any returned failure status.

    Declaration
    public override Task<OutcomeStatusResult<IList<AdbColumnSchema>>> GetTableColumnsAsync(IAdbTableIdentifier tableIdentifier)
    Parameters
    Type Name Description
    IAdbTableIdentifier tableIdentifier

    The identifier for a table-like object to check. It must specify table name, but schema and/or catalog names can be null, in which case the current schema and catalog for the connection is used. Providers where 'database' and 'schema' means the same thing, i.e. MySqlClient, put the database/schema in the schema property.

    Returns
    Type Description
    Task<OutcomeStatusResult<IList<AdbColumnSchema>>>

    On success, Status will be Succeeded, and Result will be populated with the table columns.

    On failure, Status will have a failure status, and Result will be null.

    Note that for the few database types that report more than MaxValue (e.g. MySql longblob reporting 4GB), the LengthInCharacters property will be set to MaxValue since ADO.NET database parameters uses Int32 sizes.

    An incorrect parameter will throw immediately. Any other exceptions or failures will be caught and contained in the returned OutcomeStatus, which should then be logged by the caller. If a .NET provider doesn't support retrieving this information, an Error status with a NotSupportedException is returned.

    See the provider documentation for specific Open() exceptions. Some providers may throw if the connection is associated with a transaction.

    Overrides
    AdbGenericTableInformationService.GetTableColumnsAsync(IAdbTableIdentifier)
    Exceptions
    Type Condition
    ArgumentException

    tableIdentifier.UnquotedTableName cannot be null or only whitespace.

    ArgumentNullException

    tableIdentifier

    GetTableTypeAsync(IAdbTableIdentifier)

    Check if a table-like object exists, and what type (table, view, etc.) it is.

    With a MySQL™ or MariaDB™ data source, this method and workers using this method supports regular tables and views. Note that temporary tables are currently not supported by this method.

    Note that this method does not log errors. Instead the caller should normally log any returned failure status.

    Declaration
    public override Task<OutcomeStatusResult<AdbTableType>> GetTableTypeAsync(IAdbTableIdentifier tableIdentifier)
    Parameters
    Type Name Description
    IAdbTableIdentifier tableIdentifier

    The identifier for a table-like object to check. It must specify table name, but schema and/or catalog names can be null, in which case the current schema and catalog for the connection is used. Providers where 'database' and 'schema' means the same thing, i.e. MySqlClient, put the database/schema in the schema property. See MySQL Schema Object Names for background information.

    Returns
    Type Description
    Task<OutcomeStatusResult<AdbTableType>>

    On success, Status will be Succeeded, and Result will describe if the table exists, and if so, what type (table, view, etc.)

    On failure, Status will have a failure status, and Result will be undefined.

    An incorrect parameter will throw immediately. Any other exceptions or failures will be caught and contained in the returned OutcomeStatus, which should then be logged by the caller.

    See the provider documentation for specific Open() exceptions. Some providers may throw if the connection is associated with a transaction.

    Overrides
    AdbGenericTableInformationService.GetTableTypeAsync(IAdbTableIdentifier)
    Exceptions
    Type Condition
    ArgumentException

    tableIdentifier.UnquotedTableName cannot be null or only whitespace.

    ArgumentNullException

    tableIdentifier

    Implements

    IAdbTableInformationService

    See Also

    MySql.Data.MySqlClient provider article
    AdbMySqlClientTableCommandService
    AdbMySqlClientDataSourceInformationService
    AdbConnection
    AdbProvider
    In This Article
    Back to top Copyright © 2023 Envobi Ltd