Giter Club home page Giter Club logo

mssql.io's Introduction

Sql.IO

A wrapper providing System.IO functionality for MsSql FileTables and MsSql FileStreams.

This libary allows you to work with MS SQL FileTable and MS SQL FileStreams objects using APIs similar to System.IO apis.

Sql.IO is being developed to serve as a foundation for a new C# Document Management System (DMS) which will offer document management functionality through a RestFul Web API.

I also doubles as new virtual file system for use in conjunction with the Fubar Development Portable C# FTP server (https://github.com/FubarDevelopment/FtpServer).

Using SQL file tables, the file stream and directory heirarchy are exposed as windows file share.

Updates to the underlying SQL file objects are automatically synchrozized with the file in the share.

For details on how this works see : https://www.sqlshack.com/managing-data-in-sql-server-filetables/

var newFile = new SqlFileInfo(Path.Combine(directoryFullName , "newDirectory", "newFile.txt"));

var newFileDirectory = newFile.Directory;
Assert.IsFalse(newFileDirectory.Exists);

newFileDirectory.Create();
Assert.IsTrue(newFile.Directory.Exists);

//Work directly with the file using built-in System.IO apis.
using (var sw = new StreamWriter(newFile.Create()))
{
	sw.WriteLine("Unit Test");
}
Assert.IsTrue(newFile.Exists);


var anotherDirectory = SqlDirectory.Create(Path.Combine(directoryFullName, "anotherDirectory"));
Assert.IsNotNull(anotherDirectory);
Assert.IsTrue(anotherDirectory.Exists);
Assert.IsTrue(anotherDirectory.FullName.StartsWith(directoryFullName));

newFile.MoveTo(Path.Combine(anotherDirectory.FullName, newFile.Name));


newFileDirectory.Delete();
Assert.IsFalse(newFileDirectory.Exists);

mssql.io's People

Contributors

alexhiggins732 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

sss-software

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.