C# Класс ZocBuild.Database.ScriptRepositories.FileSystemScriptRepository

Represents a script repository that stores build scripts at a location on disk.
This repository requires a specific directory structure. The root location must contain subdirectories for each database schema, each named with the name of the schema. Within those directories should be a directory for each database object type: Function, Procedure, Type, View. Within those directories should be the build scripts, with file names ending with ".sql". The name of each file should be the same name as the database object it creates.
Наследование: IScriptRepository
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
FileSystem IFileSystem
IsFileInSupportedDirectory bool>.Func
Logger ILogger

Открытые методы

Метод Описание
FileSystemScriptRepository ( DirectoryInfoBase scriptDirectory, string serverName, string databaseName, IFileSystem fileSystem, IParser sqlParser, ILogger logger, bool ignoreUnsupportedSubdirectories ) : System

Instantiates a file system repository for the given database at the specified directory location.

FileSystemScriptRepository ( string scriptDirectoryPath, string serverName, string databaseName, IFileSystem fileSystem, IParser sqlParser, ILogger logger, bool ignoreUnsupportedSubdirectories ) : System

Instantiates a file system repository for the given database at the specified directory location.

GetAllScriptsAsync ( ) : Task>

Gets all the build scripts for database objects contained in the repository.

GetChangedScriptsAsync ( ) : Task>

This method is not supported and calling it will raise a NotSupportedException.

GetScriptAsync ( TypedDatabaseObject dbObject ) : Task

Retrieves the build script corresponding to the given database object identifier.

GetScriptFile ( TypedDatabaseObject dbObject ) : System.IO.Abstractions.FileInfoBase

Retrieves the script file for the given database object identifier, if and only if the database object belongs to this script repository.

Защищенные методы

Метод Описание
GetScriptAsync ( System.IO.Abstractions.FileInfoBase file ) : Task

Retrieves the build script contained in the given file.

GetScriptsAsync ( ) : Task>

Gets the build scripts in the repository that satisfy the given predicate.

Приватные методы

Метод Описание
GetDropScript ( TypedDatabaseObject dbObject ) : string

Описание методов

FileSystemScriptRepository() публичный Метод

Instantiates a file system repository for the given database at the specified directory location.
public FileSystemScriptRepository ( DirectoryInfoBase scriptDirectory, string serverName, string databaseName, IFileSystem fileSystem, IParser sqlParser, ILogger logger, bool ignoreUnsupportedSubdirectories ) : System
scriptDirectory System.IO.Abstractions.DirectoryInfoBase The directory where build scripts are located.
serverName string The name of the database server.
databaseName string The name of the database.
fileSystem IFileSystem An object that provides access to the file system.
sqlParser IParser The sql script parser for reading the SQL file contents.
logger ILogger A Logger
ignoreUnsupportedSubdirectories bool A flag indicating whether to ignore subdirectories that don't conform to the expected naming convention.
Результат System

FileSystemScriptRepository() публичный Метод

Instantiates a file system repository for the given database at the specified directory location.
public FileSystemScriptRepository ( string scriptDirectoryPath, string serverName, string databaseName, IFileSystem fileSystem, IParser sqlParser, ILogger logger, bool ignoreUnsupportedSubdirectories ) : System
scriptDirectoryPath string The path to the directory where build scripts are located.
serverName string The name of the database server.
databaseName string The name of the database.
fileSystem IFileSystem An object that provides access to the file system.
sqlParser IParser The sql script parser for reading the SQL file contents.
logger ILogger A Logger
ignoreUnsupportedSubdirectories bool A flag indicating whether to ignore subdirectories that don't conform to the expected naming convention.
Результат System

GetAllScriptsAsync() публичный Метод

Gets all the build scripts for database objects contained in the repository.
public GetAllScriptsAsync ( ) : Task>
Результат Task>

GetChangedScriptsAsync() публичный Метод

This method is not supported and calling it will raise a NotSupportedException.
public GetChangedScriptsAsync ( ) : Task>
Результат Task>

GetScriptAsync() защищенный Метод

Retrieves the build script contained in the given file.
protected GetScriptAsync ( System.IO.Abstractions.FileInfoBase file ) : Task
file System.IO.Abstractions.FileInfoBase The file containing a build script
Результат Task

GetScriptAsync() публичный Метод

Retrieves the build script corresponding to the given database object identifier.
public GetScriptAsync ( TypedDatabaseObject dbObject ) : Task
dbObject TypedDatabaseObject The database object for which a build script is desired.
Результат Task

GetScriptFile() публичный Метод

Retrieves the script file for the given database object identifier, if and only if the database object belongs to this script repository.
public GetScriptFile ( TypedDatabaseObject dbObject ) : System.IO.Abstractions.FileInfoBase
dbObject TypedDatabaseObject The database object for which a script file is desired.
Результат System.IO.Abstractions.FileInfoBase

GetScriptsAsync() защищенный Метод

Gets the build scripts in the repository that satisfy the given predicate.
protected GetScriptsAsync ( ) : Task>
Результат Task>

Описание свойств

FileSystem защищенное свойство

The contract for interacting with the file system.
protected IFileSystem FileSystem
Результат IFileSystem

IsFileInSupportedDirectory защищенное свойство

A function that indicates whether a given file is in a managed directory.
protected Func IsFileInSupportedDirectory
Результат bool>.Func

Logger защищенное свойство

A Logger
protected ILogger Logger
Результат ILogger