Skip to content
alexhiggins732 edited this page May 20, 2019 · 1 revision

Sql.IO

Contents

FileTableQueryProvider type

Namespace

Sql.IO

Summary

A concret implementation of the IFileTableQueryProvider used to generate Sql required for retrieving SqlFileSystemEntry objects from a SqlFileTable.

ChildDirectoriesQuery(table_Name) method

Summary

SQl needed to execute retrieve directorsy the specified SqlFileTable.

Returns
Parameters
Name Type Description
table_Name System.String

IFileTableQueryProvider type

Namespace

Sql.IO

Summary

A SQL generator for retrieving SqlFileSystemEntry objects from a SqlFileTable.

ChildDirectoriesQuery(table_Name) method

Summary

SQl needed to execute retrieve directorsy the specified SqlFileTable.

Returns
Parameters
Name Type Description
table_Name System.String

Resources type

Namespace

Sql.IO.Properties

Summary

A strongly-typed resource class, for looking up localized strings, etc.

Culture property

Summary

Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class.

GetChildDirectoriesQueryFormat property

Summary

Looks up a localized string similar to SELECT
{0} FROM [{1}] WHERE [is_directory] =1 and [parent_path_locator].ToString()={2} .

ResourceManager property

Summary

Returns the cached ResourceManager instance used by this class.

SqlContext type

Namespace

Sql.IO

Summary

Represents a database context for connecting to the Sql Datbase where the SqlFileSystemEntry are located

#ctor(connectionStringProvider) constructor

Summary

Initalizes a new instance of the SqlContext using the conection string supplied by the IConnectionStringProvider

Parameters
Name Type Description
connectionStringProvider Sql.IO.IConnectionStringProvider

Current constants

Summary

An instance of the current SqlConnection

queryProvider constants

Summary

A TSQL provider used to format and generate TSQL DDL for database operations.

ConnectionString property

Summary

The connection string for the SqlContext instance;

GetChildDirectories(table_Name,param) method

Summary

Returns a list of SqlDirectoryInfo in the spe

Returns
Parameters
Name Type Description
table_Name System.String
param System.Object

GetConnectionStringProviderForPath(path) method

Summary

Returns the IConnectionStringProvider used to connext to the datbase containing the SqlFileTable for the specified path.

Returns
Parameters
Name Type Description
path System.String A string containing SqlPathInfo to lookup the IConnectionStringProvider for.

GetConnectionStringProviderForPath(pahtInfo) method

Summary

Returns the IConnectionStringProvider used to connect to the datbase containing the SqlFileTable for the specified path.

Returns
Parameters
Name Type Description
pahtInfo Sql.IO.SqlPathInfo The SqlPathInfo to lookup the IConnectionStringProvider for.

GetRequiredService``1() method

Summary

Development stub for Dependency Injection until an IOC container is chosen.

Returns
Parameters

This method has no parameters.

Generic Types
Name Description
T

Get``1(sql,param) method

Summary

Executes a query returning the data typed as T.

Returns
Parameters
Name Type Description
sql System.String The SQL to execute for the query.
param System.Object The parameters to pass, if any.
Generic Types
Name Description
T The type of the results to return.

SqlDirectory type

Namespace

Sql.IO

Summary

Helper extensions to extend commonly used Directory methods so they can be used with a SqlDirectoryInfo.

Create(path) method

Summary

Creates a new directory at the specified path and returns a SqlDirectoryInfo for the directory.

Returns
Parameters
Name Type Description
path System.String

Delete(path) method

Summary

Deletes the directory at the specified path. If the directory is not empty an exception is thrown. To delete a directory and all of its contents use the Delete overload.

Returns
Parameters
Name Type Description
path System.String The path of the directory to delete.

Delete(path,recursive) method

Summary

Deletes the directory at the specified path.

Returns
Parameters
Name Type Description
path System.String The path of the directory to delete.
recursive System.Boolean If set to false and the directory is not empty an exception is thrown.
If set to true the directory and all content in the direcrtory and all of its subdirectories are deleted.

EnumerateDirectories(path) method

Summary

Returns a list of SqlDirectoryInfo located in the specified path.

Returns
Parameters
Name Type Description
path System.String The path to enumerate.

EnumerateFileSystemInfo(path) method

Summary

Returns a list of SqlFileSystemInfo located in the specified path.

Returns
Parameters
Name Type Description
path System.String The path to enumerate.

EnumerateFiles(path) method

Summary

Returns a list of SqlFileInfo located in the specified path.

Returns
Parameters
Name Type Description
path System.String The path to enumerate.

Exists(path) method

Summary

Returns true if a directory exists at the specified path.

Returns
Parameters
Name Type Description
path System.String The path to check.

GetParent(path) method

Summary

Returns the parent of the directory at the specified path.

Returns
Parameters
Name Type Description
path System.String The path to return the parent for.

Move(srcPath,destinationPath) method

Summary

Moves a file or a directory and its contents to a new location.

Parameters
Name Type Description
srcPath System.String The path to the file or directory to be moved.
destinationPath System.String The path to move the content at the source to.
If the source if a file then destinationPath must also be a file name.
If the source is a directory then destinationPath must also be a directory.

SqlDirectoryInfo type

Namespace

Sql.IO

Summary

Provides DirectoryInfo and FileSystemInfo style functionality for a SqlDirectoryInfo entry in the SqlFileTable.

#ctor(entry,connectionStringProvider,fileTable) constructor

Summary

Initialize a new SqlDirectoryInfo based on the metadata in the specified SqlFileSystemEntry.

Parameters
Name Type Description
entry Sql.IO.SqlFileSystemEntry The metadata for the SqlDirectoryInfo.
connectionStringProvider Sql.IO.IConnectionStringProvider A connection string provider for accessing the underlying SqlFileTable for perform IO operations.
fileTable Sql.IO.SqlFileTable The SqlFileTable for the SqlDirectoryInfo.

#ctor(fullPath) constructor

Summary

Initializes a new SqlDirectoryInfo based on the specified path.

Parameters
Name Type Description
fullPath System.String The full path to the directory.

Cached_File_Size property

Summary

Cached_File_Size is not implemented for a SqlDirectoryInfo. Throws a NotImplementedException

File_Type property

Summary

File Type is not implemented for a SqlDirectoryInfo. Throws a NotImplementedException

Is_Directory property

Summary

A flag indicating the underlying SqlFileSystemInfo is a directory.

Name property

Summary

The name of the SqlDirectoryInfo.

Create() method

Summary

Creates a new directory.

Parameters

This method has no parameters.

GetDirectories() method

Summary

Gets a list of sub directories that exist in the current directory.

Returns
Parameters

This method has no parameters.

GetFiles() method

Summary

Gets a list of files that exist in the current directory.

Returns
Parameters

This method has no parameters.

MoveTo(destinationPath) method

Summary

Moves the directory and all of its content to the destination path

Parameters
Name Type Description
destinationPath System.String

SqlFile type

Namespace

Sql.IO

Summary

Helper extensions to extend commonly used File methods to a SqlFileInfo's underlying stream

WindowsEncoding constants

Summary

The default Windows-1252 Code Page

Create(path) method

Summary

Creates a new empty file at the specified locatoin and returns the SqlFileInfo for the file.

Returns
Parameters
Name Type Description
path System.String

Move(sourcePath,destinationPath) method

Summary

Moves a file from the specified source path to the specified destination path

Parameters
Name Type Description
sourcePath System.String
destinationPath System.String

ReadAllBytes(sqlFileInfo) method

Summary

Reads the contents of the SqlFileInfo's underlying stream as a byte array using Windows-1252 Encoding.

Returns
Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileTable

ReadAllBytes(sqlFileInfo) method

Summary

Reads the contents of the SqlFileInfo's underlying stream as a byte array using Windows-1252 Encoding.

Returns
Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileInfo

ReadAllBytes(sqlFileInfo) method

Summary

Reads the contents of the SqlFileInfo's underlying stream as a byte array using Windows-1252 Encoding.

Returns
Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileTable

ReadAllBytes(sqlFileInfo,encoding) method

Summary

Reads the contents of the SqlFileInfo's underlying stream as a byte array using the specified Encoding.

Returns
Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileInfo
encoding System.Text.Encoding

ReadAllLines(sqlFileInfo) method

Summary

Reads the contents of the SqlFileInfo as string array.

Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileTable

ReadAllLines(sqlFileInfo) method

Summary

Reads the contents of the SqlFileInfo as string array.

Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileInfo

ReadAllText(sqlFileInfo) method

Summary

Reads the contents of the SqlFileInfo's underlying stream as string.

Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileTable

ReadAllText(sqlFileInfo) method

Summary

Reads the contents of the SqlFileInfo's underlying stream as string.

Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileInfo

WriteAllBytes(sqlFileInfo,value) method

Summary

Writes the specified byte array to the SqlFileInfo's underlying stream using Windows-1252 Encoding. If the file exists, it's content is overwritten.

Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileTable
value System.Guid

WriteAllBytes(sqlFileInfo,value) method

Summary

Writes the specified byte array to the SqlFileInfo's underlying stream using Windows-1252 Encoding. If the file exists, it's content is overwritten.

Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileInfo
value System.Byte[]

WriteAllBytes(sqlFileInfo,value) method

Summary

Writes the specified byte array to the SqlFileInfo's underlying stream using the specified Encoding. If the file exists, it's content is overwritten.

Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileTable
value System.Guid

WriteAllBytes(sqlFileInfo,value) method

Summary

Writes the specified byte array to the SqlFileInfo's underlying stream using the specified Encoding. If the file exists, it's content is overwritten.

Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileInfo
value System.Byte[]

WriteAllLines(sqlFileInfo,value) method

Summary

Writes the specified string array to the SqlFileInfo's underlying stream. If the file exists, it's content is overwritten.

Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileTable
value System.Guid

WriteAllLines(sqlFileInfo,value) method

Summary

Writes the specified string array to the SqlFileInfo's underlying stream. If the file exists, it's content is overwritten.

Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileInfo
value System.String[]

WriteAllText(sqlFileInfo,value) method

Summary

Writes the specified string to the SqlFileInfo's underlying stream. If the file exists, it's content is overwritten.

Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileTable
value System.Guid

WriteAllText(sqlFileInfo,value) method

Summary

Writes the specified string to the SqlFileInfo's underlying stream. If the file exists, it's content is overwritten.

Parameters
Name Type Description
sqlFileInfo Sql.IO.SqlFileInfo
value System.String

SqlFileInfo type

Namespace

Sql.IO

Summary

Provides FileInfo and FileSystemInfo style functionality for a file in the SqlFileTable.

#ctor(entry,connectionStringProvider,fileTable) constructor

Summary

Initialize a new SqlFileInfo based on the metadata in the specified SqlFileSystemEntry.

Parameters
Name Type Description
entry Sql.IO.SqlFileSystemEntry The metadata for the SqlFileInfo.
connectionStringProvider Sql.IO.IConnectionStringProvider A connection string provider for accessing the underlying SqlFileTable for perform IO operations.
fileTable Sql.IO.SqlFileTable The SqlFileTable for the SqlFileInfo.

#ctor(fullPath) constructor

Summary

Initializes a SqlFileSystemInfo based on the specified path.

Parameters
Name Type Description
fullPath System.String The full path to the file.

Is_Directory property

Summary

Flag to indicate the underlying SqlFileSystemInfo is a file and not a directory.

Create() method

Summary

Creates a new file and returns a references to a stream for performing IO operations on the underlying file content.

Returns
Parameters

This method has no parameters.

File_Stream() method

Summary

The SqlFileStream of the actual file content, This value is null for directories or empty for files with no content.

Parameters

This method has no parameters.

MoveTo(destinationPath) method

Summary

Moves the file to the specified destination path

Parameters
Name Type Description
destinationPath System.String

OpenNew() method

Summary

Opens overwrites and existing file and return a new stream for performing IO operations on the underlying file content.

Returns
Parameters

This method has no parameters.

SqlFileStream type

Namespace

Sql.IO

Summary

A StreamWrapper to provide functionality to work with a Sql FileStream as if it were a regular FileStream.

Close() method

Summary

Closes the underlying file stream after updating the File's content in the database if has been modified.

Parameters

This method has no parameters.

update() method

Summary

Updates the file content in database with the content of the underlying stream.

Parameters

This method has no parameters.

SqlFileSystemEntry type

Namespace

Sql.IO

Summary

Domain object model of SQL FileTable records that provide meta data for SqlFileSystemInfo implementations the SqlFileInfo and SqlDirectoryInfo.

Cached_File_Size property

Summary

A cache of the Length computed using datalength(file_stream). This value will be when Is_Directory is . There are rare edge cases in which this value could temporarily be out of sync.

File_Type property

Summary

A persisted computed column that contains the extension of the file. Calculated using the database function getextension(name). This value will be when the file has no extension or Is_Directory is .

FullName property

Summary

The full path and name of the file or foder. The MaxLengthAttribute is 260.

Is_Archive property

Summary

A flag representing if the Archive attribute is set.

Is_Directory property

Summary

A flag to indicate if the entry is a directory. When the value is the entry is a file.

Is_Hidden property

Summary

A flag representing if the Hidden attribute is set.

Is_Offline property

Summary

A flag representing if the Offline attribute is set.

Is_Readonly property

Summary

A flag representing if the ReadOnly attribute is set.

Is_System property

Summary

A flag representing if the System attribute is set.

Is_Temporary property

Summary

A flag representing if the Temporary attribute is set.

Last_Access_Time property

Summary

Contains the LastAccessTime. This will be until the file is accessed.

Remarks

Stored in the database with a precion of 34 and scale of 7

Last_Write_Time property

Summary

Contains the LastWriteTime

Remarks

Stored in the database with a precion of 34 and scale of 7

Name property

Summary

The name of the file or folder. The MaxLengthAttribute is 255.

Path_Locator property

Summary

The primary key of the table containing the heirarchyid for the file or folder.

Stream_Id property

Summary

A UniqueIdentifier rowguidcol column for each FILESTREAM in the FILETABLE

SqlFileSystemInfo type

Namespace

Sql.IO

Summary

Provides FileSystemInfo style functionality and synchorizes underlying SqlFileSystemEntry metadata.

#ctor(entry,connectionStringProvider,fileTable) constructor

Summary

Initialize a new SqlFileSystemInfo based on the metadata in the specified SqlFileSystemEntry.

Parameters
Name Type Description
entry Sql.IO.SqlFileSystemEntry The metadata for the SqlFileSystemInfo.
connectionStringProvider Sql.IO.IConnectionStringProvider A connection string provider for accessing the underlying SqlFileTable for perform IO operations.
fileTable Sql.IO.SqlFileTable The SqlFileTable for the SqlDirectoryInfo.

#ctor(fullPath) constructor

Summary

Initializes a new SqlFileSystemInfo based on the specified path.

Parameters
Name Type Description
fullPath System.String The full path to the directory.

Cached_File_Size property

Summary

A cache of the Length computed using datalength(file_stream). This value will be when Is_Directory is . There are rare edge cases in which this value could temporarily be out of sync.

Directory property

Summary

Returns the parent SqlDirectoryInfo for this SqlFileSystemInfo.

Exists property

Summary

Returns true if this SqlFileSystemInfo exists by determining if there is a corresponding SqlFileSystemEntry in the underlying SqlFileTable.

File_Type property

Summary

A persisted computed column that contains the extension of the file. Calculated using the database function getextension(name). This value will be when the file has no extension or Is_Directory is .

FullName property

Summary

The full path and name of the file or foder. The MaxLengthAttribute is 260.

Is_Archive property

Summary

A flag representing if the Archive attribute is set.

Is_Directory property

Summary

A flag to indicate if the entry is a directory. When the value is the entry is a file.

Is_Hidden property

Summary

A flag representing if the Hidden attribute is set.

Is_Offline property

Summary

A flag representing if the Offline attribute is set.

Is_Readonly property

Summary

A flag representing if the ReadOnly attribute is set.

Is_System property

Summary

A flag representing if the System attribute is set.

Is_Temporary property

Summary

A flag representing if the Temporary attribute is set.

Last_Access_Time property

Summary

Contains the LastAccessTime. This will be until the file is accessed.

Remarks

Stored in the database with a precion of 34 and scale of 7

Last_Write_Time property

Summary

Contains the LastWriteTime

Remarks

Stored in the database with a precion of 34 and scale of 7

Name property

Summary

The name of the file or folder. The MaxLengthAttribute is 255.

Path_Locator property

Summary

The primary key of the table containing the heirarchyid for the file or folder.

Stream_Id property

Summary

A UniqueIdentifier rowguidcol column for each FILESTREAM in the FILETABLE

Delete() method

Summary

Deletes this SqlFileSystemInfo from the underlying SqlFileTable which triggers a physical deletion from disk. If entry is a SqlDirectoryInfo and it is not empty an exception is thrown. To delete a directory and all of its contents use Delete

Parameters

This method has no parameters.

Delete() method

Summary

Deletes this SqlFileSystemInfo from the underlying SqlFileTable which triggers a physical deletion from disk. If the directory is not empty an exception is thrown

Parameters

This method has no parameters.

UpdateMeta(dbEntry) method

Summary

Synchorized data with the specified SqlFileSystemEntry.

Parameters
Name Type Description
dbEntry Sql.IO.SqlFileSystemEntry

SqlFileTable type

Namespace

Sql.IO

Summary

A class providing style functionality to directories and files saved in a Sql File Table.

#ctor(connectionStringProvider,objectId,enabled,directoryName,tableName) constructor

Summary

Initializes a new SqlFileTables to provide services for accessing SqlFileSystemInfo meta data defined in the File Table.

Parameters
Name Type Description
connectionStringProvider Sql.IO.IConnectionStringProvider
objectId System.Int64
enabled System.Boolean
directoryName System.String
tableName System.String

Directory_Name property

Summary

The name of the directory where the contents of the SqlFileTable file exists on disk.

Is_Enabled property

Summary

A flag indicating if the SqlFileTable is enabled.

Object_Id property

Summary

The native object_id for the SqlFileTable in the Sql Server.

Table_Name property

Summary

Then Sql table name of the SqlFileTable in the Sql Server database.

connectionStringProvider property

Summary

A provider to supply connection string information to the server and database where the SqlFileTable exists.

GetAllEntries() method

Summary

Returns metadata for every SqlFileSystemEntry row in the SqlFileTable.

Returns
Parameters

This method has no parameters.

GetDirectories() method

Summary

Returns a list of all SqlDirectoryInfo that exist in the root of the SqlFileTable. This method provides the functionality similar to GetDirectories.

Returns
Parameters

This method has no parameters.

GetDirectory(stream_Id) method

Summary

Retrieves a SqlDirectoryInfo from the SqlFileTable based on its stream_Id. If the record does not exist in the database a DirectoryNotFoundException is thrown.

Returns
Parameters
Name Type Description
stream_Id System.Guid

GetEntry(path) method

Summary

Internal method to retriee the metadata for a SqlFileSystemEntry based on it's path.

Returns
Parameters
Name Type Description
path System.String

GetFile(stream_Id) method

Summary

Retrieves a SqlFileInfo from the SqlFileTable based on its stream_Id. If the record does not exist in the database a FileNotFoundException is thrown.

Returns
Parameters
Name Type Description
stream_Id System.Guid

GetFiles() method

Summary

Returns a list of all SqlFileInfo that exist in the root of the SqlFileTable. This method provides the functionality similar to GetFiles.

Returns
Parameters

This method has no parameters.

GetSqlFileTable(connectionStringProvider,directoryName) method

Summary

Returns a SqlFileTable from the database based on its Directory_Name.

Returns
Parameters
Name Type Description
connectionStringProvider Sql.IO.IConnectionStringProvider
directoryName System.String

GetSqlFileTables(connectionStringProvider) method

Summary

Returns a list of all SqlFileTables defined in the specified database.

Returns
Parameters
Name Type Description
connectionStringProvider Sql.IO.IConnectionStringProvider

SqlFileTableInfo type

Namespace

Sql.IO

Summary

Domain model for retrieving FileTable meta data from the Sql database.

directory_name property

Summary

The name of the directory where the contents of the file exists.

is_enabled property

Summary

A flag indicating if the FileTable is enabled.

object_id property

Summary

The native object_id for this file table in the Sql Server.

table_name property

Summary

Then name of the FileTable in the Sql Server database.

SqlLocator type

Namespace

Sql.IO

Summary

Static utilities for working with SqlLocatorIds

ToSqlLocator(guid) method

Summary

An extension to easily convert a Guid to a SqlLocatorId

Returns
Parameters
Name Type Description
guid System.Guid

SqlLocatorId type

Namespace

Sql.IO

Summary

Provides utilities from create new Locator Path's used in Native SQL Heirachy Ids.

#ctor(locatorId) constructor

Summary

Initialize a new Sql Locator from a string in the format of [LowValue].[MidValue].[LongValue]

Parameters
Name Type Description
locatorId System.String A Locator Id in the format of [LowValue].[MidValue].[LongValue]

#ctor(first,middle,last) constructor

Summary

Creates a SqlLocatorId from the specified Int64 values.

Parameters
Name Type Description
first System.Int64 The first value of the SqlLocatorId
middle System.Int64 the middle value of the SqlLocatorId
last System.Int64 the last value of the SqlLocatorId

longBuffer constants

Summary

A static empty buffer for parsing Int64s from a Byte array used to minimize allocations.

longFromGuidBytes constants

Summary

A static function for parsing a long from a slice of a Big Edian Byte array.

LongValues property

Summary

An array of longs repesented in the SqlLocatorId

m_value property

Summary

The string representation of the Locator Id for this node, formatted as [LowValue].[MidValue].[LongValue]

NewId() method

Summary

Creates a new unique SqlLocatorId using NewGuid

Returns
Parameters

This method has no parameters.

Parse(guid) method

Summary

Parses a SqlLocatorId from the bytes of a Guid.

Returns
Parameters
Name Type Description
guid System.Guid

ParseGuids(locatorPath) method

Summary

Parses the Guids from a path containing SqlLocatorIds.

Returns
Parameters
Name Type Description
locatorPath System.String

ToGuid() method

Summary

Converts the SqlLocatorId to a Guid

Returns
Parameters

This method has no parameters.

ToString() method

Summary

The string representation of the SqlLocatorId

Returns
Parameters

This method has no parameters.

longToGuidByteSlice(guidBytes,longValue,start,count) method

Summary

A static function to parse GuidBytes from a Little Edian longs.

Parameters
Name Type Description
guidBytes System.Byte[] The target byte array to copy the Int64Bytes to
longValue System.Int64 The input Int64 to parse Little Edian Bytes from
start System.Int32 The start index of the guidBytes to copy to
count System.Int32 The number of bytes to copy

SqlPath type

Namespace

Sql.IO

Summary

Utility class for parsing SqlPathInfo from file paths;

GetFileStreamDirectory(path) method

Summary

Parses the FileStreamDirectory segment of a path.

Returns
Parameters
Name Type Description
path System.String The UNC path to parse.

GetFileSystemInfo(path) method

Summary

Gets a SqlFileSystemInfo for the specified path.

Returns
Parameters
Name Type Description
path System.String The path to the SqlFileSystemInfo

GetFileTableDirectory(path) method

Summary

Parses the FileTableDirectory segment of a path.

Returns
Parameters
Name Type Description
path System.String The UNC path to parse.

GetFileTableRelativePath(path) method

Summary

Parses the RelativePath segment of a path.

Returns
Parameters
Name Type Description
path System.String The UNC path to parse.

GetRootPath(path) method

Summary

Gets the root directory information from the specified path.

Returns
Parameters
Name Type Description
path System.String The path to get the root directory information from

GetUncRoot(path) method

Summary

Parses the UncRoot segment of a path.

Returns
Parameters
Name Type Description
path System.String The UNC path to parse.

IsPathRooted(path) method

Summary

Deterimines if the specified path contains a root.

Returns
Parameters
Name Type Description
path System.String The UNC path to parse.

SqlPathInfo type

Namespace

Sql.IO

Summary

A utililty class for parsing the logical directory heirarchy from a supplied path

FileStreamDirectory property

Summary

If present, the name of the File Stream directory parsed from the supplied path.

FileTableDirectory property

Summary

If present, the name of the FileTable directory parsed from the supplied path.

InstanceName property

Summary

The Instance name of the Sql Server parsed from the supplied path.

OriginalPath property

Summary

The original path supplied to the parser.

RelativePath property

Summary

If present, the absolute path, relative to FileStreamDirectory, parsed from the supplied path.

ServerName property

Summary

The Machine Name or Virtual Network Name of the SQL server parsed from the supplied path.

UncRoot property

Summary

The root UNC directory parse from the supplied path. The will be the \ServerName\InstanceName part of the path.

Parse() method

Summary

Parses SqlPathInfo from the specified UNC path. At a minimum the path must contain a valid UncRoot or an error will be thrown. The FileStreamDirectory, FileTableDirectory and RelativePath are also parsed if present.

Parameters

This method has no parameters.

Remarks

For details specs on path formats, see: https://docs.microsoft.com/en-us/sql/relational-databases/blob/work-with-directories-and-paths-in-filetables?view=sql-server-2017

StreamWrapper type

Namespace

Sql.IO

Summary

A utility class to wrap a prexisiting stream. Used to expose SqlFileStream to external libraries without requiring Custom Dll references. Otherwise, all websites and APIs using this libary would be required to install SqlClr dlls which additionally contains DataTypes not currently support on .Net Stander or .Net Core single SqlFileStream is currently only compatiable with MsSql on windows.

StringConnectionProvider type

Namespace

Sql.IO

Summary

Concreted implementation of the IConnectionStringProvider allowing a ConnectionString to be resolved using Dependency Injection.

#ctor(connectionString) constructor

Summary

Initialzes a new StringConnectionProvider.

Parameters
Name Type Description
connectionString System.String The used to open a connection to the database.

ConnectionString property

Summary

The string that is used to open a connection to the database. See: ConnectionString

Clone this wiki locally