Package | net4 | netstandard1.3 |
Xtricate.Common | ||
Xtricate.Configuration | ||
Xtricate.DocSet | ||
Xtricate.DocSet.Sqlite | ||
Xtricate.DocSet.Serilog | ||
Xtricate.Dynamic | ||
Xtricate.Tmpl | ||
Xtricate.Web.Dashboard |
TODO
DocSet provides document like storage with basic querying on Microsoft SQLServer. Documents are stored as JSON with keys and tags. The keys and tags are used to retrieve documents. By using an optional indexmap basic querying becomes possible. Indexed fields are stored in seperate table columns for performance reasons. All database assets are created automaticly when needed (database/tables/columns/indexes).
- setup the storage
var options = new StorageOptions(new ConnectionStrings().Get(connectionName), databaseName: databaseName, schemaName: schemaName);
var connectionFactory = new SqlConnectionFactory();
var indexMap = TestDocumentIndexMap;
var storage = new DocStorage<TestDocument>(
connectionFactory, options, new SqlBuilder(),
new JsonNetSerializer(), new Md5Hasher(), indexMap);
- instantiate a test document
var document = new Customer
{
FirstName = "John",
LastName = "Doe"
}
- insert or update document value with key and tags
storage.Upsert("mykey", document);
storage.Upsert("mykey", document, new[] {"en-US"});
- insert or update document data with key and tags
var stream = File.OpenRead(@".\cat.jpg");
storage.Upsert("mykey", stream);
storage.Upsert("mykey", document, stream);
storage.Upsert("mykey", stream, new[] {"en-US", "cat"});
- query document values
var document = storage.LoadValues("mykey");
var document = storage.LoadValues(new[] {"en-US"});
var document = storage.LoadValues("mykey", new[] {"en-US"});
- query document data
var stream = storage.LoadData("mykey");
var stream = storage.LoadData(new[] {"en-US"});
var stream = storage.LoadData("mykey", new[] {"en-US"});
- remove documents
storage.Delete("mykey");
storage.Delete( new[] {"en-US"});
storage.Delete("mykey", new[] {"en-US"});
- uid (uniqueidentifier)
- id (int)
- key (nvarchar:512)
- tags (nvarchar:1024)
- hash (nvarchar:128)
- timestamp (datetime)
- value (ntext) contains the JSON document
- data (varbinary:max) contains the binary data
- ???_idx (nvarchar:2048)
TODO
TODO
TODO
TODO
TODO
TODO
Create nice sequence diagrams with https://www.websequencediagrams.com/
- with using blocks
using (new Seq("CLIENT", enabled: true, loggingEnabled: true))
{
using (new Seq("SERVICE", "handle get request", "return json"))
{
using (new Seq("REPO", "get entities", "return entities"))
{
// do nothing
}
}
}
var name = Seq.RenderDiagram();
// name equals the local filename containing the sequence diagram as a image (png)
- integrated with actual code blocks
using (new Seq("CLIENT", "make a service request", enabled: true, loggingEnabled: true))
{
Seq.Self("filter grid");
var service = new Service(new Repo());
service.Get();
}
var name = Seq.RenderDiagram();
// name equals the local filename containing the sequence diagram as a image (png)
public class Service
{
private readonly Repo _repo;
public Service(Repo repo)
{
_repo = repo;
}
public void Get()
{
using (Seq.Call("SERVICE", "handle GET request", "return json"))
{
Validate();
MapQuery();
_repo.GetData();
}
}
private void MapQuery()
{
Seq.Self("parse querystring");
}
private void Validate()
{
Seq.Note("fluentvalidation");
using (Seq.Call("SERVICE", "validate"))
{
}
}
}
public class Repo
{
public void GetData()
{
using (Seq.Call("REPO", "get entities", "return entities"))
{
Seq.Self("get connection string");
Seq.Note("make connection");
Seq.Note("execute sql");
Seq.Note("map to entity");
}
}
}
Do you have a bug or a feature request? Please use the issue tracker and search for existing and closed issues. If your problem or request isn't addressed yet, go ahead and open a new issue.
You can also get involved and fork the repository to submit your own pull requests.
For transparency and to maintain backward compatibility (as much as possible), this project uses the Semantic Versioning guidelines.
- vip32 - for the initial conception and core contributor.