MySqlDbaServices

Provides DBA services for MySql.

Namespace:
KpokPatagon.Data.MySql.Dba
Type:
Class
Public:
Yes
Protected:
No
Sealed:
Yes
Abstract:
No

Constructors

MySqlDbaServices

Initializes a new instance of MySqlDbaServices.

Signature:
public Void MySqlDbaServices(databaseApi, formatter)
Parameters
Name Type Summary
databaseApi IDbAccess
formatter IDbFormatter

Properties

DatabaseApi

Database communication API.

Signature:
public IDbAccess DatabaseApi { get; }

Formatter

An IDbFormatter for Sql Server.

Signature:
public IDbFormatter Formatter { get; }

Methods

ChangeUserPassword

Changes a user password.

Signature:
public Void ChangeUserPassword(user)
Parameters
Name Type Summary
user User A User to change it's password.
Exceptions
Type Summary
ArgumentNullException Thrown when user is null.
ValidationException Thrown when the provided input is not valid to run this operation.
SchemaManipulationException Thrown when an error occurs while manipulating the schema.

CreateUser

Creates a user to connect to the database.

Signature:
public Void CreateUser(user)
Parameters
Name Type Summary
user User A User to be created.
Exceptions
Type Summary
ArgumentNullException Thrown when user is null.
ValidationException Thrown when the provided input is not valid to run this operation.
SchemaManipulationException Thrown when an error occurs while manipulating the schema.

DropSchema

Creates a schema named name.

Signature:
public Void DropSchema(name)
Parameters
Name Type Summary
name String Name of the schema to create.
Exceptions
Type Summary
SchemaManipulationException Thrown when an error occurs while manipulating the schema.
ArgumentNullOrEmptyException Thrown when name is null or empty.

DropUser

Drops a user.

Signature:
public Void DropUser(name)
Parameters
Name Type Summary
name String The name of the user to drop.
Exceptions
Type Summary
ArgumentNullOrEmptyException Thrown when name is null or empty.
SchemaManipulationException Thrown when an error occurs while manipulating the schema.

ExistsUserc

Checks if a user named name exists.

Signature:
public Boolean ExistsUserc(name)
Returns

true is the user exists, otherwise false.

Parameters
Name Type Summary
name String Name of the user to check.
Exceptions
Type Summary
SchemaManipulationException Thrown when an error occurs while manipulating the schema.
ArgumentNullOrEmptyException Thrown when name is null or empty.

GrantUserAccessToSchema

Grants the user all access to the specified schema.

Signature:
public Void GrantUserAccessToSchema(user, schema)
Parameters
Name Type Summary
user String User name to grant access to.
schema String Schema to grant to the user.
Exceptions
Type Summary
ArgumentNullOrEmptyException

Thrown when user is null or empty.

-or- schema is null or empty.

SchemaManipulationException Thrown when an error occurs while manipulating the schema.