├── .editorconfig
├── .gitattributes
├── .github
├── FUNDING.yml
├── dependabot.yml
└── workflows
│ ├── build.yml
│ ├── pr.yml
│ └── publish.yml
├── .gitignore
├── .vscode
├── launch.json
└── tasks.json
├── .whitesource
├── LICENSE.txt
├── NuGet.config
├── README.md
├── YesSql.sln
├── samples
├── YesSql.Bench
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── YesSql.Bench.csproj
├── YesSql.Samples.FullText
│ ├── Indexes
│ │ ├── ArticleByWord.cs
│ │ └── ArticleIndexProvider.cs
│ ├── Models
│ │ └── Article.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Tokenizers
│ │ ├── ITokenFilter.cs
│ │ ├── ITokenizer.cs
│ │ ├── StopWordFilter.cs
│ │ └── WhiteSpaceTokenizer.cs
│ └── YesSql.Samples.FullText.csproj
├── YesSql.Samples.Hi
│ ├── Indexes
│ │ ├── BlogPostByAuthor.cs
│ │ ├── BlogPostByDay.cs
│ │ └── BlogPostIndexProvider.cs
│ ├── Models
│ │ └── BlogPost.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── YesSql.Samples.Hi.csproj
├── YesSql.Samples.Performance
│ ├── Benchmarks.cs
│ ├── Program.cs
│ ├── User.cs
│ └── YesSql.Samples.Performance.csproj
└── YesSql.Samples.Web
│ ├── Controllers
│ └── HomeController.cs
│ ├── Indexes
│ └── BlogPostIndexProvider.cs
│ ├── ModelBinding
│ ├── FilterEngineModelBinder.cs
│ └── QueryFilterEngineModelBinder.cs
│ ├── Models
│ └── BlogPost.cs
│ ├── Program.cs
│ ├── Properties
│ └── launchSettings.json
│ ├── Services
│ └── WebQueryExecutionContext.cs
│ ├── ViewModels
│ └── BlogPostViewModel.cs
│ ├── Views
│ ├── Home
│ │ └── Index.cshtml
│ └── _ViewImports.cshtml
│ └── YesSql.Samples.Web.csproj
├── src
├── Directory.Build.props
├── Directory.Packages.props
├── Versions.props
├── YesSql.Abstractions
│ ├── Commands
│ │ ├── IAddColumnCommand.cs
│ │ ├── IAddIndexCommand.cs
│ │ ├── IAlterColumnCommand.cs
│ │ ├── IAlterTableCommand.cs
│ │ ├── IColumnCommand.cs
│ │ ├── ICreateColumnCommand.cs
│ │ ├── ICreateForeignKeyCommand.cs
│ │ ├── ICreateSchemaCommand.cs
│ │ ├── ICreateTableCommand.cs
│ │ ├── IDropColumnCommand.cs
│ │ ├── IDropForeignKeyCommand.cs
│ │ ├── IDropIndexCommand.cs
│ │ ├── IDropTableCommand.cs
│ │ ├── IRenameColumnCommand.cs
│ │ ├── ISchemaCommand.cs
│ │ ├── ITableCommand.cs
│ │ └── SqlStatementCommand.cs
│ ├── ConcurrencyException.cs
│ ├── Document.cs
│ ├── IAccessor.cs
│ ├── IAccessorFactory.cs
│ ├── ICollection.cs
│ ├── ICommandInterpreter.cs
│ ├── ICompiledQuery.cs
│ ├── IConfiguration.cs
│ ├── IConnectionFactory.cs
│ ├── IContentSerializer.cs
│ ├── IIdGenerator.cs
│ ├── IQuery.cs
│ ├── ISchemaBuilder.cs
│ ├── ISession.cs
│ ├── ISqlBuilder.cs
│ ├── ISqlDialect.cs
│ ├── ISqlFunction.cs
│ ├── IStore.cs
│ ├── IStringBuilder.cs
│ ├── ITableNameConvention.cs
│ ├── ITypeService.cs
│ ├── IdentityColumnSize.cs
│ ├── Indexes
│ │ ├── DescribeContext.cs
│ │ ├── DescribeFor.cs
│ │ ├── IDescriptor.cs
│ │ ├── IIndex.cs
│ │ ├── IIndexProvider.cs
│ │ ├── IndexDescriptor.cs
│ │ ├── IndexProvider.cs
│ │ ├── MapIndex.cs
│ │ └── ReduceIndex.cs
│ ├── JoinType.cs
│ ├── QueryExtensions.cs
│ ├── SchemaBuilderExtensions.cs
│ ├── SessionExtensions.cs
│ ├── SimplifiedTypeNameAttribute.cs
│ ├── SqlBuilderExtensions.cs
│ ├── Storage
│ │ ├── DocumentIdentity.cs
│ │ └── IIdentityEntity.cs
│ └── YesSql.Abstractions.csproj
├── YesSql.Core
│ ├── Commands
│ │ ├── BatchCommand.cs
│ │ ├── CreateDocumentCommand.cs
│ │ ├── CreateIndexCommand.cs
│ │ ├── DeleteDocumentCommand.cs
│ │ ├── DeleteMapIndexCommand.cs
│ │ ├── DeleteReduceIndexCommand.cs
│ │ ├── DocumentCommand.cs
│ │ ├── IIndexCommand.cs
│ │ ├── IndexCommand.cs
│ │ ├── UpdateDocumentCommand.cs
│ │ └── UpdateIndexCommand.cs
│ ├── Configuration.cs
│ ├── ConfigurationExtensions.cs
│ ├── Data
│ │ ├── AliasBinding.cs
│ │ ├── DapperDataHandlers.cs
│ │ ├── MapState.cs
│ │ ├── NullableThumbprintFactory.cs
│ │ ├── PropertyAccessorFactory.cs
│ │ ├── WorkDispatcher.cs
│ │ └── WorkerQueryKey.cs
│ ├── DbConnectionProviderFactory.cs
│ ├── GlobalSuppressions.cs
│ ├── Indexes
│ │ └── IdentityMap.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Provider
│ │ ├── BaseDialect.cs
│ │ └── ServiceCollectionExtensions.cs
│ ├── Serialization
│ │ ├── DefaultContentSerializer.cs
│ │ ├── DynamicJsonConverter.cs
│ │ ├── PropertyInfoAccessor.cs
│ │ └── UtcDateTimeJsonConverter.cs
│ ├── Services
│ │ ├── DbBlockIdGenerator.cs
│ │ ├── DefaultIdGenerator.cs
│ │ ├── DefaultQuery.cs
│ │ ├── DefaultTableNameConvention.cs
│ │ ├── EnumerableExtensions.cs
│ │ ├── IndexProviderRegisterExtensions.cs
│ │ ├── PredicateNodes.cs
│ │ └── TypeService.cs
│ ├── Session.cs
│ ├── SessionState.cs
│ ├── Sql
│ │ ├── BaseComandInterpreter.cs
│ │ ├── MappingFunction.cs
│ │ ├── Schema
│ │ │ ├── AddColumnCommand.cs
│ │ │ ├── AddIndexCommand.cs
│ │ │ ├── AlterColumnCommand.cs
│ │ │ ├── AlterTableCommand.cs
│ │ │ ├── ColumnCommand.cs
│ │ │ ├── CreateColumnCommand.cs
│ │ │ ├── CreateForeignKeyCommand.cs
│ │ │ ├── CreateSchemaCommand.cs
│ │ │ ├── CreateTableCommand.cs
│ │ │ ├── DropColumnCommand.cs
│ │ │ ├── DropForeignKeyCommand.cs
│ │ │ ├── DropIndexCommand.cs
│ │ │ ├── DropTableCommand.cs
│ │ │ ├── RenameColumnCommand .cs
│ │ │ ├── SchemaCommand.cs
│ │ │ ├── SqlStatementCommand.cs
│ │ │ └── TableCommand.cs
│ │ ├── SchemaBuilder.cs
│ │ ├── SqlBuilder.cs
│ │ └── TemplateFunction.cs
│ ├── Store.cs
│ ├── StoreFactory.cs
│ ├── Utils
│ │ ├── HashHelper.cs
│ │ └── RentedStringBuilder.cs
│ └── YesSql.Core.csproj
├── YesSql.Filters.Abstractions
│ ├── Builders
│ │ ├── BooleanEngineBuilder.cs
│ │ ├── DefaultTermEngineBuilder.cs
│ │ ├── NamedTermEngineBuilder.cs
│ │ ├── OperatorBuilder.cs
│ │ ├── TermEngineBuilder.cs
│ │ └── UnaryEngineBuilder.cs
│ ├── Nodes
│ │ ├── FilterNode.cs
│ │ ├── OperatorNodes.cs
│ │ └── TermNodes.cs
│ ├── Services
│ │ ├── FilterExecutionContext.cs
│ │ ├── FilterResult.cs
│ │ ├── IFilterParser.cs
│ │ ├── IFilterVisitor.cs
│ │ └── TermOption.cs
│ └── YesSql.Filters.Abstractions.csproj
├── YesSql.Filters.Query
│ ├── IQueryParser.cs
│ ├── QueryBooleanEngineBuilder.cs
│ ├── QueryEngineBuilder.cs
│ ├── QueryEngineBuilderExtensions.cs
│ ├── QueryFilterResult.cs
│ ├── QueryFilterResultExtensions.cs
│ ├── QueryTermEngineBuilderExtensions.cs
│ ├── QueryUnaryEngineBuilder.cs
│ ├── Services
│ │ ├── QueryExecutionContext.cs
│ │ ├── QueryFilterVisitor.cs
│ │ ├── QueryParseContext.cs
│ │ ├── QueryParser.cs
│ │ └── QueryTermOption.cs
│ └── YesSql.Filters.Query.csproj
├── YesSql.Provider.MySql
│ ├── MySqlCommandInterpreter.cs
│ ├── MySqlDbProviderOptionsExtensions.cs
│ ├── MySqlDialect.cs
│ └── YesSql.Provider.MySql.csproj
├── YesSql.Provider.PostgreSql
│ ├── PostgreSqlCommandInterpreter.cs
│ ├── PostgreSqlDbProviderOptionsExtensions.cs
│ ├── PostgreSqlDialect.cs
│ └── YesSql.Provider.PostgreSql.csproj
├── YesSql.Provider.SqlServer
│ ├── SqlServerComandInterpreter.cs
│ ├── SqlServerDbProviderOptionsExtensions.cs
│ ├── SqlServerDialect.cs
│ └── YesSql.Provider.SqlServer.csproj
├── YesSql.Provider.Sqlite
│ ├── GlobalSuppressions.cs
│ ├── SqliteCommandInterpreter.cs
│ ├── SqliteDbProviderOptionsExtensions.cs
│ ├── SqliteDialect.cs
│ └── YesSql.Provider.Sqlite.csproj
├── YesSql
│ └── YesSql.csproj
├── YesSqlKey.snk
└── yessql.pub
└── test
└── YesSql.Tests
├── Commands
└── DeleteDocumentCommand.cs
├── CompiledQueries
└── PersonByAgeCompileQuery.cs
├── ConsoleLogger.cs
├── CoreTests.cs
├── DecimalPrecisionAndScaleDataGenerator.cs
├── Filters
└── QueryEngineTests.cs
├── GlobalSuppressions.cs
├── HashHelperTests.cs
├── Indexes
├── ArticleByDate.cs
├── ArticleByDay.cs
├── AttachmentByDay.cs
├── Binary.cs
├── CarIndex.cs
├── EmailByAttachment.cs
├── LongestNameByLetter.cs
├── PersonByAge.cs
├── PersonByBothNamesCol.cs
├── PersonByName.cs
├── PersonByNameCol.cs
├── PersonByNullableAge.cs
├── PersonIdentity.cs
├── PersonsByName.cs
├── PropertyIndex.cs
├── PublishedArticles.cs
├── Shapes.cs
├── TypesIndex.cs
└── User.cs
├── Models
├── Animal.cs
├── Article.cs
├── Car.cs
├── Drawing.cs
├── Email.cs
├── Person.cs
├── Products.cs
├── Property.cs
├── TestConstants.cs
└── Tree.cs
├── MySqlTests.cs
├── NullableThumbprint
├── Discriminators.cs
└── NullableThumbprintFactoryTests.cs
├── PostgreSqlLegacyIdentityTests.cs
├── PostgreSqlTests.cs
├── Properties
└── AssemblyInfo.cs
├── ProviderTests.cs
├── SqlServer2017Tests.cs
├── SqlServer2019Tests.cs
├── SqlServerTests.cs
├── SqliteLegacyIdentityTests.cs
├── SqliteTests.cs
├── TemporaryFolder.cs
├── TestLogger.cs
├── WorkerQueryKeyTests.cs
├── YesSql.Tests.csproj
└── xunit.runner.json
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [sebastienros]
2 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "nuget" # See documentation for possible values
9 | directory: "/" # Location of package manifests
10 | schedule:
11 | interval: "weekly"
12 | groups:
13 | # Grouped version updates configuration
14 | all-dependencies:
15 | patterns:
16 | - "*"
17 | exclude-patterns:
18 | - "*Abstractions" # Don't update abstractions packages
19 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | bin
3 | Bin
4 | obj
5 | _ReSharper*
6 | *.user
7 | *.patch
8 | *.hg
9 | *.sln.cache
10 | desktop.ini
11 | *.ReSharper
12 | *.orig
13 | *.suo
14 | *.itrace.csdef
15 | *.build.csdef
16 | packages
17 | src/*.testsettings
18 | src/TestResults
19 | src/*.vsmdi
20 | artifacts
21 | *.vsp
22 | project.lock.json
23 | *.mdb
24 | .vs/
25 | .build/
26 | .testPublish/
27 | .idea
28 | yessql.db
29 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "name": ".NET Core Attach",
6 | "type": "coreclr",
7 | "request": "attach",
8 | "processId": "${command:pickProcess}"
9 | },
10 | {
11 | "name": ".NET Core Launch (Samples.Hi)",
12 | "type": "coreclr",
13 | "request": "launch",
14 | "preLaunchTask": "Dotnet Build Debug",
15 | "program": "${workspaceRoot}/samples/YesSql.Samples.Hi/bin/Debug/netstandardapp1.5/win7-x64/YesSql.Samples.Hi.exe",
16 | "args": [],
17 | "cwd": "${workspaceRoot}/samples/YesSql.Samples.Hi",
18 | "stopAtEntry": false
19 | },
20 | {
21 | "name": ".NET Core Launch (Samples.Performance)",
22 | "type": "coreclr",
23 | "request": "launch",
24 | "preLaunchTask": "Dotnet Build Debug",
25 | "program": "${workspaceRoot}/samples/YesSql.Samples.Performance/bin/Debug/netstandardapp1.5/win7-x64/YesSql.Samples.Performance.exe",
26 | "args": [],
27 | "cwd": "${workspaceRoot}/samples/YesSql.Samples.Performance",
28 | "stopAtEntry": false
29 | },
30 | {
31 | "name": ".NET Core Launch (Samples.FullText)",
32 | "type": "coreclr",
33 | "request": "launch",
34 | "preLaunchTask": "Dotnet Build Debug",
35 | "program": "${workspaceRoot}/samples/YesSql.Samples.FullText/bin/Debug/netstandardapp1.5/win7-x64/YesSql.Samples.FullText.exe",
36 | "args": [],
37 | "cwd": "${workspaceRoot}/samples/YesSql.Samples.FullText",
38 | "stopAtEntry": false
39 | },
40 | {
41 | "name": ".NET Core Launch (Samples.Bench)",
42 | "type": "coreclr",
43 | "request": "launch",
44 | "preLaunchTask": "Dotnet Build Debug",
45 | "program": "${workspaceRoot}/samples/YesSql.Bench/bin/Debug/netstandardapp1.5/win7-x64/YesSql.Bench.exe",
46 | "args": [],
47 | "cwd": "${workspaceRoot}/samples/YesSql.Bench",
48 | "stopAtEntry": false
49 | },
50 | {
51 | "name": ".NET Core Launch (Samples.Web)",
52 | "type": "coreclr",
53 | "request": "launch",
54 | "preLaunchTask": "Dotnet Build Web Debug",
55 | "program": "${workspaceRoot}/samples/YesSql.Samples.Web/bin/Debug/net5.0/YesSql.Samples.Web.dll",
56 | "args": [],
57 | "cwd": "${workspaceRoot}/samples/YesSql.Samples.Web",
58 | "stopAtEntry": false
59 | },
60 | ]
61 | }
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "linux": { "command": "sh", "args": ["-c"] },
4 | "osx": { "command": "sh", "args": ["-c"] },
5 | "windows": {
6 | "command": "cmd",
7 | "args": [
8 | "/C"
9 | ]
10 | },
11 | "tasks": [
12 | {
13 | "label": "Dotnet Restore",
14 | "type": "shell",
15 | "args": [
16 | "dotnet restore"
17 | ],
18 | "problemMatcher": []
19 | },
20 | {
21 | "label": "Dotnet Force Restore",
22 | "type": "shell",
23 | "args": [
24 | "dotnet restore --no-cache"
25 | ],
26 | "problemMatcher": []
27 | },
28 | {
29 | "label": "Dotnet Rebuild Debug",
30 | "type": "shell",
31 | "args": [
32 | "dotnet build ${workspaceRoot}/samples/YesSql.Samples.Hi --no-incremental -c Debug"
33 | ],
34 | "problemMatcher": "$msCompile"
35 | },
36 | {
37 | "label": "Dotnet Build Debug",
38 | "type": "shell",
39 | "args": [
40 | "dotnet build ${workspaceRoot}/samples/YesSql.Samples.Hi -c Debug"
41 | ],
42 | "problemMatcher": "$msCompile",
43 | "group": {
44 | "_id": "build",
45 | "isDefault": false
46 | }
47 | },
48 | {
49 | "label": "Dotnet Build Release",
50 | "type": "shell",
51 | "args": [
52 | "dotnet build ${workspaceRoot}/samples/YesSql.Samples.Hi -c Release"
53 | ],
54 | "problemMatcher": "$msCompile"
55 | },
56 | {
57 | "label": "Dotnet Run",
58 | "type": "shell",
59 | "args": [
60 | "cd ${workspaceRoot}/samples/YesSql.Samples.Hi & dotnet run"
61 | ],
62 | "problemMatcher": []
63 | },
64 | {
65 | "label": "Dotnet Build Web Debug",
66 | "type": "shell",
67 | "args": [
68 | "dotnet build ${workspaceRoot}/samples/YesSql.Samples.Web -c Debug"
69 | ],
70 | "problemMatcher": "$msCompile",
71 | "group": {
72 | "_id": "build",
73 | "isDefault": false
74 | }
75 | },
76 | {
77 | "label": "Gulp Build",
78 | "type": "shell",
79 | "args": [
80 | "gulp build"
81 | ],
82 | "problemMatcher": "$gulp-tsc"
83 | }
84 | ]
85 | }
86 |
--------------------------------------------------------------------------------
/.whitesource:
--------------------------------------------------------------------------------
1 | {
2 | "scanSettings": {
3 | "baseBranches": []
4 | },
5 | "checkRunSettings": {
6 | "vulnerableCheckRunConclusionLevel": "failure",
7 | "displayMode": "diff",
8 | "useMendCheckNames": true
9 | },
10 | "issueSettings": {
11 | "minSeverityLevel": "LOW",
12 | "issueType": "DEPENDENCY"
13 | }
14 | }
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | Copyright (c) 2012 Sebastien Ros
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5 |
6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7 |
8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/NuGet.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/samples/YesSql.Bench/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("YesSql.Bench")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("YesSql.Bench")]
12 | [assembly: AssemblyCopyright("Copyright © 2015")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("1f7e3e43-c859-4090-a0c7-739249a45511")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/samples/YesSql.Bench/YesSql.Bench.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net8.0
4 | portable
5 | true
6 | YesSql.Bench
7 | Exe
8 | YesSql.Bench
9 | false
10 | false
11 | false
12 | false
13 | false
14 | false
15 | false
16 | false
17 | false
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.FullText/Indexes/ArticleByWord.cs:
--------------------------------------------------------------------------------
1 | using YesSql.Indexes;
2 |
3 | namespace YesSql.Samples.FullText.Indexes
4 | {
5 | public class ArticleByWord : ReduceIndex
6 | {
7 | public string Word { get; set; }
8 | public int Count { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.FullText/Indexes/ArticleIndexProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using YesSql.Indexes;
3 | using YesSql.Samples.FullText.Models;
4 | using YesSql.Samples.FullText.Tokenizers;
5 |
6 | namespace YesSql.Samples.FullText.Indexes
7 | {
8 | public class ArticleIndexProvider : IndexProvider
9 | {
10 | public override void Describe(DescribeContext context)
11 | {
12 | var tokenizer = new WhiteSpaceTokenizer();
13 | var filter = new StopWordFilter();
14 |
15 | context
16 | .For()
17 | .Map(article => filter
18 | .Filter(tokenizer.Tokenize(article.Content))
19 | .Select(x => new ArticleByWord { Word = x, Count = 1 })
20 | )
21 | .Group(article => article.Word)
22 | .Reduce(group => new ArticleByWord
23 | {
24 | Word = group.Key,
25 | Count = group.Sum(y => y.Count)
26 | })
27 | .Delete((index, map) =>
28 | {
29 | index.Count -= map.Sum(x => x.Count);
30 |
31 | // if Count == 0 then delete the index
32 | return index.Count > 0 ? index : null;
33 | });
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/samples/YesSql.Samples.FullText/Models/Article.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql.Samples.FullText.Models
2 | {
3 | public class Article
4 | {
5 | public string Content { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.FullText/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("YesSql.Samples.FullText")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("YesSql.Samples.FullText")]
12 | [assembly: AssemblyCopyright("Copyright © 2015")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("d59b4d5b-43e6-4b9a-94e7-37bbd4686560")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.FullText/Tokenizers/ITokenFilter.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace YesSql.Samples.FullText.Tokenizers
4 | {
5 | public interface ITokenFilter
6 | {
7 | IEnumerable Filter(IEnumerable tokens);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.FullText/Tokenizers/ITokenizer.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace YesSql.Samples.FullText.Tokenizers
4 | {
5 | public interface ITokenizer
6 | {
7 | IEnumerable Tokenize(string text);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.FullText/Tokenizers/StopWordFilter.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 |
4 | namespace YesSql.Samples.FullText.Tokenizers
5 | {
6 | public class StopWordFilter : ITokenFilter
7 | {
8 | public IEnumerable Filter(IEnumerable tokens)
9 | {
10 | return tokens.Where(token => token.Length >= 2);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.FullText/Tokenizers/WhiteSpaceTokenizer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace YesSql.Samples.FullText.Tokenizers
5 | {
6 | public class WhiteSpaceTokenizer : ITokenizer
7 | {
8 | public IEnumerable Tokenize(string text)
9 | {
10 | var start = 0;
11 | for (var cur = 0; cur < text.Length; cur++)
12 | {
13 | if (Char.IsLetter(text[cur])) continue;
14 |
15 | if (cur - start > 1)
16 | {
17 | yield return text.Substring(start, cur - start);
18 | }
19 |
20 | start = cur + 1;
21 | }
22 |
23 | if (start != text.Length)
24 | {
25 | yield return text.Substring(start);
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.FullText/YesSql.Samples.FullText.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net8.0
4 | portable
5 | true
6 | YesSql.Samples.FullText
7 | Exe
8 | YesSql.Samples.FullText
9 | false
10 | false
11 | false
12 | false
13 | false
14 | false
15 | false
16 | false
17 | false
18 | 8
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Hi/Indexes/BlogPostByAuthor.cs:
--------------------------------------------------------------------------------
1 | using YesSql.Indexes;
2 |
3 | namespace YesSql.Samples.Hi.Indexes
4 | {
5 | public class BlogPostByAuthor : MapIndex
6 | {
7 | public string Author { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Hi/Indexes/BlogPostByDay.cs:
--------------------------------------------------------------------------------
1 | using YesSql.Indexes;
2 |
3 | namespace YesSql.Samples.Hi.Indexes
4 | {
5 | public class BlogPostByDay : ReduceIndex
6 | {
7 | public string Day { get; set; }
8 | public int Count { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Hi/Indexes/BlogPostIndexProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using YesSql.Indexes;
3 | using YesSql.Samples.Hi.Models;
4 |
5 | namespace YesSql.Samples.Hi.Indexes
6 | {
7 | public class BlogPostIndexProvider : IndexProvider
8 | {
9 | public override void Describe(DescribeContext context)
10 | {
11 | // for each BlogPost, create a BlogPostByAuthor index
12 | context.For()
13 | .Map(blogPost =>
14 | new BlogPostByAuthor { Author = blogPost.Author }
15 | );
16 |
17 | // for each BlogPost, aggregate in an exiting BlogPostByDay
18 | context.For()
19 | .Map(blogPost =>
20 | new BlogPostByDay
21 | {
22 | Day = blogPost.PublishedUtc.ToString("yyyyMMdd"),
23 | Count = 1
24 | })
25 | .Group(blogPost => blogPost.Day)
26 | .Reduce(group =>
27 | new BlogPostByDay
28 | {
29 | Day = group.Key,
30 | Count = group.Sum(p => p.Count)
31 | })
32 | .Delete((index, map) =>
33 | {
34 | index.Count -= map.Sum(x => x.Count);
35 |
36 | // if Count == 0 then delete the index
37 | return index.Count > 0 ? index : null;
38 | }
39 | );
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Hi/Models/BlogPost.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace YesSql.Samples.Hi.Models
4 | {
5 | public class BlogPost
6 | {
7 | public string Title { get; set; }
8 | public string Author { get; set; }
9 | public string Content { get; set; }
10 | public DateTime PublishedUtc { get; set; }
11 | public string[] Tags { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Hi/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("YesSql.Samples.Hi")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("YesSql.Samples.Hi")]
12 | [assembly: AssemblyCopyright("Copyright © 2015")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("a40bca62-e3a6-4273-b2d2-98f70d19552e")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Hi/YesSql.Samples.Hi.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net8.0
4 | portable
5 | true
6 | YesSql.Samples.Hi
7 | Exe
8 | YesSql.Samples.Hi
9 | false
10 | false
11 | false
12 | false
13 | false
14 | false
15 | false
16 | false
17 | false
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Performance/Program.cs:
--------------------------------------------------------------------------------
1 | using BenchmarkDotNet.Running;
2 |
3 | namespace YesSql.Samples.Performance
4 | {
5 | public class Program
6 | {
7 | static void Main(string[] args)
8 | {
9 | var summary = BenchmarkRunner.Run();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Performance/User.cs:
--------------------------------------------------------------------------------
1 | using YesSql.Indexes;
2 |
3 | namespace YesSql.Samples.Performance
4 | {
5 | public class User
6 | {
7 | //public int Id { get; set; }
8 | public string Email { get; set; }
9 | public string Name { get; set; }
10 | }
11 |
12 | public class UserByName : MapIndex
13 | {
14 | public string Name { get; set; }
15 | }
16 |
17 | public class UserIndexProvider : IndexProvider
18 | {
19 | public override void Describe(DescribeContext context)
20 | {
21 | context.For()
22 | .Map(user => new UserByName { Name = user.Name });
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Performance/YesSql.Samples.Performance.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net8.0
4 | YesSql.Samples.Performance
5 | Exe
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Web/Indexes/BlogPostIndexProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using YesSql.Indexes;
3 | using YesSql.Samples.Web.Models;
4 |
5 | namespace YesSql.Samples.Web.Indexes
6 | {
7 | public class BlogPostIndex : MapIndex
8 | {
9 | public string Title { get; set; }
10 |
11 | public string Author { get; set; }
12 |
13 | public string Content { get; set; }
14 | public DateTime PublishedUtc { get; set; }
15 | public bool Published { get; set; }
16 |
17 | }
18 |
19 | public class BlogPostIndexProvider : IndexProvider
20 | {
21 | public override void Describe(DescribeContext context)
22 | {
23 | context
24 | .For()
25 | .Map(blogPost => new BlogPostIndex
26 | {
27 | Title = blogPost.Title,
28 | Author = blogPost.Author,
29 | Content = blogPost.Content,
30 | PublishedUtc = blogPost.PublishedUtc,
31 | Published = blogPost.Published
32 | });
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Web/ModelBinding/FilterEngineModelBinder.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Threading.Tasks;
4 | using Microsoft.AspNetCore.Mvc.ModelBinding;
5 |
6 | namespace YesSql.Samples.Web.ModelBinding
7 | {
8 | public abstract class FilterEngineModelBinder : IModelBinder
9 | {
10 | public abstract TResult Parse(string text);
11 |
12 | public Task BindModelAsync(ModelBindingContext bindingContext)
13 | {
14 | if (bindingContext == null)
15 | {
16 | throw new ArgumentNullException(nameof(bindingContext));
17 | }
18 |
19 | var modelName = bindingContext.ModelName;
20 |
21 | // Try to fetch the value of the argument by name q=
22 | var valueProviderResult = bindingContext.ValueProvider.GetValue(modelName);
23 |
24 | if (valueProviderResult == ValueProviderResult.None)
25 | {
26 | bindingContext.Result = ModelBindingResult.Success(Parse(string.Empty));
27 |
28 | return Task.CompletedTask;
29 | }
30 |
31 | bindingContext.ModelState.SetModelValue(modelName, valueProviderResult);
32 |
33 | var value = valueProviderResult.FirstValue;
34 |
35 | // Check if the argument value is null or empty
36 | if (string.IsNullOrEmpty(value))
37 | {
38 | bindingContext.Result = ModelBindingResult.Success(Parse(string.Empty));
39 |
40 | return Task.CompletedTask;
41 | }
42 |
43 | var filterResult = Parse(value);
44 |
45 | bindingContext.Result = ModelBindingResult.Success(filterResult);
46 |
47 | return Task.CompletedTask;
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Web/ModelBinding/QueryFilterEngineModelBinder.cs:
--------------------------------------------------------------------------------
1 | using YesSql.Filters.Query;
2 |
3 | namespace YesSql.Samples.Web.ModelBinding
4 | {
5 | public class QueryFilterEngineModelBinder : FilterEngineModelBinder> where T : class
6 | {
7 | private readonly IQueryParser _parser;
8 |
9 | public QueryFilterEngineModelBinder(IQueryParser parser)
10 | {
11 | _parser = parser;
12 | }
13 |
14 | public override QueryFilterResult Parse(string text)
15 | => _parser.Parse(text);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Web/Models/BlogPost.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace YesSql.Samples.Web.Models
4 | {
5 | public class BlogPost
6 | {
7 | public long Id { get; set; }
8 |
9 | public string Title { get; set; }
10 |
11 | public string Author { get; set; }
12 |
13 | public string Content { get; set; }
14 |
15 | public DateTime PublishedUtc { get; set; }
16 | public bool Published { get; set; }
17 |
18 | public string[] Tags { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Web/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:42529/",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "YesSql.Samples.Web": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "environmentVariables": {
22 | "ASPNETCORE_ENVIRONMENT": "Development"
23 | },
24 | "applicationUrl": "http://localhost:42530"
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Web/Services/WebQueryExecutionContext.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using YesSql.Filters.Query.Services;
3 |
4 | namespace YesSql.Samples.Web.Services
5 | {
6 | public class WebQueryExecutionContext : QueryExecutionContext where T : class
7 | {
8 | public WebQueryExecutionContext(IServiceProvider serviceProvider, IQuery query) : base(query)
9 | {
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Web/ViewModels/BlogPostViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.AspNetCore.Mvc;
3 | using Microsoft.AspNetCore.Mvc.ModelBinding;
4 | using Microsoft.AspNetCore.Mvc.Rendering;
5 | using YesSql.Samples.Web.Models;
6 | using YesSql.Samples.Web.ModelBinding;
7 | using YesSql.Filters.Query;
8 |
9 | namespace YesSql.Samples.Web.ViewModels
10 | {
11 | public class BlogPostViewModel
12 | {
13 | public IEnumerable BlogPosts { get; set; }
14 | public Filter Search { get; set; }
15 | }
16 |
17 | public class Filter
18 | {
19 | public string Author { get; set; }
20 | public string SearchText { get; set; }
21 | public string OriginalSearchText { get; set; }
22 | public BlogPostStatus SelectedStatus { get; set; }
23 | public BlogPostSort SelectedSort { get; set; }
24 |
25 | [ModelBinder(BinderType = typeof(QueryFilterEngineModelBinder), Name = nameof(SearchText))]
26 | public QueryFilterResult FilterResult { get; set; }
27 |
28 | [BindNever]
29 | public List Statuses { get; set; } = new();
30 |
31 | [BindNever]
32 | public List Sorts { get; set; } = new();
33 | }
34 |
35 | public enum BlogPostStatus
36 | {
37 | Default,
38 | Draft,
39 | Published
40 | }
41 |
42 | public enum BlogPostSort
43 | {
44 | Newest,
45 | Oldest,
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Web/Views/Home/Index.cshtml:
--------------------------------------------------------------------------------
1 | @using YesSql.Samples.Web.Models
2 | @using YesSql.Samples.Web.ViewModels
3 | @using System.Collections.Generic
4 |
5 | @model BlogPostViewModel
6 |
7 |
8 |
9 |
10 |
11 |
12 |
40 |
41 | @foreach (var blogPost in Model.BlogPosts)
42 | {
43 |
44 |
45 |
@blogPost.Title
46 |
By: @blogPost.Author - Posted: @@ @blogPost.PublishedUtc
47 |
@blogPost.Content
48 |
49 |
50 | }
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Web/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 |
2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
3 |
--------------------------------------------------------------------------------
/samples/YesSql.Samples.Web/YesSql.Samples.Web.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | false
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/Directory.Packages.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/Versions.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2.1.66
5 | 6.0.0
6 |
7 |
8 |
9 |
10 | 2.1.35
11 |
12 |
13 | 5.2.2
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/IAddColumnCommand.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql.Sql.Schema
2 | {
3 | public interface IAddColumnCommand : ICreateColumnCommand
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/IAddIndexCommand.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql.Sql.Schema
2 | {
3 | public interface IAddIndexCommand : ITableCommand
4 | {
5 | string IndexName { get; set; }
6 | string[] ColumnNames { get; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/IAlterColumnCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace YesSql.Sql.Schema
4 | {
5 | public interface IAlterColumnCommand : IColumnCommand
6 | {
7 | IAlterColumnCommand WithType(Type dbType, int? length);
8 | IAlterColumnCommand WithType(Type dbType, byte precision, byte scale);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/IAlterTableCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace YesSql.Sql.Schema
4 | {
5 | public interface IAlterTableCommand : ISchemaCommand
6 | {
7 | void AddColumn(string columnName, Type dbType, Action column = null);
8 | void AddColumn(string columnName, Action column = null);
9 | void AlterColumn(string columnName, Action column = null);
10 | void RenameColumn(string columnName, string newName);
11 | void DropColumn(string columnName);
12 | void CreateIndex(string indexName, params string[] columnNames);
13 | void DropIndex(string indexName);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/IColumnCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace YesSql.Sql.Schema
4 | {
5 | public interface IColumnCommand : ITableCommand
6 | {
7 | string ColumnName { get; }
8 |
9 | byte? Scale { get; }
10 |
11 | byte? Precision { get; }
12 |
13 | Type DbType { get; }
14 |
15 | object Default { get; }
16 |
17 | int? Length { get; }
18 |
19 | IColumnCommand WithDefault(object @default);
20 |
21 | IColumnCommand WithLength(int? length);
22 |
23 | IColumnCommand Unlimited();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/ICreateColumnCommand.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql.Sql.Schema
2 | {
3 | public interface ICreateColumnCommand : IColumnCommand
4 | {
5 | bool IsUnique { get; }
6 |
7 | bool IsNotNull { get; }
8 |
9 | bool IsPrimaryKey { get; }
10 |
11 | bool IsIdentity { get; }
12 |
13 | ICreateColumnCommand PrimaryKey();
14 |
15 | ICreateColumnCommand Identity();
16 |
17 | ICreateColumnCommand WithPrecision(byte? precision);
18 |
19 | ICreateColumnCommand WithScale(byte? scale);
20 |
21 | ICreateColumnCommand NotNull();
22 |
23 | ICreateColumnCommand Nullable();
24 |
25 | ICreateColumnCommand Unique();
26 |
27 | ICreateColumnCommand NotUnique();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/ICreateForeignKeyCommand.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql.Sql.Schema
2 | {
3 | public interface ICreateForeignKeyCommand : ISchemaCommand
4 | {
5 | string[] DestColumns { get; }
6 |
7 | string DestTable { get; }
8 |
9 | string[] SrcColumns { get; }
10 |
11 | string SrcTable { get; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/ICreateSchemaCommand.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql.Sql.Schema
2 | {
3 | public interface ICreateSchemaCommand : ISchemaCommand
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/ICreateTableCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace YesSql.Sql.Schema
4 | {
5 | public interface ICreateTableCommand : ISchemaCommand
6 | {
7 | ICreateTableCommand Column(string columnName, Type dbType, Action column = null);
8 | ICreateTableCommand Column(string columnName, Action column = null);
9 | public ICreateTableCommand Column(IdentityColumnSize identityColumnSize, string columnName, Action column = null) => identityColumnSize == IdentityColumnSize.Int32 ? Column(columnName, column) : Column(columnName, column);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/IDropColumnCommand.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql.Sql.Schema
2 | {
3 | public interface IDropColumnCommand : IColumnCommand
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/IDropForeignKeyCommand.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql.Sql.Schema
2 | {
3 | public interface IDropForeignKeyCommand : ISchemaCommand
4 | {
5 | string SrcTable { get; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/IDropIndexCommand.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql.Sql.Schema
2 | {
3 | public interface IDropIndexCommand : ITableCommand
4 | {
5 | string IndexName { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/IDropTableCommand.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql.Sql.Schema
2 | {
3 | public interface IDropTableCommand : ISchemaCommand
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/IRenameColumnCommand.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql.Sql.Schema
2 | {
3 | public interface IRenameColumnCommand : IColumnCommand
4 | {
5 | string NewColumnName { get; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/ISchemaCommand.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace YesSql.Sql.Schema
4 | {
5 | public interface ISchemaCommand
6 | {
7 | string Name { get; }
8 | List TableCommands { get; }
9 | }
10 |
11 | public enum SchemaCommandType
12 | {
13 | CreateTable,
14 | DropTable,
15 | AlterTable,
16 | SqlStatement,
17 | CreateForeignKey,
18 | DropForeignKey,
19 | CreateSchema,
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/ITableCommand.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql.Sql.Schema
2 | {
3 | public interface ITableCommand : ISchemaCommand
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Commands/SqlStatementCommand.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace YesSql.Sql.Schema
4 | {
5 | public interface ISqlStatementCommand : ISchemaCommand
6 | {
7 | string Sql { get; }
8 | List Providers { get; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/ConcurrencyException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection.Metadata;
3 |
4 | namespace YesSql
5 | {
6 | public class ConcurrencyException : Exception
7 | {
8 | public Document Document { get; }
9 |
10 | public ConcurrencyException(Document document) : base($"The document with Id '{document.Id}' and type '{document.Type}' could not be updated as it has been changed by another process.")
11 | {
12 | Document = document;
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Document.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql
2 | {
3 | ///
4 | /// The class stored in the Document table of a collection.
5 | ///
6 | public class Document
7 | {
8 | ///
9 | /// The unique identifier of the document in the database.
10 | ///
11 | public long Id { get; set; }
12 |
13 | ///
14 | /// The type of the document.
15 | ///
16 | public string Type { get; set; }
17 |
18 | ///
19 | /// Gets or sets the serialized content of the document.
20 | ///
21 | public string Content { get; set; }
22 |
23 | ///
24 | /// Gets or sets the version number of the document.
25 | ///
26 | ///
27 | /// This property is used to track updates, and optionally detect concurrency violations.
28 | ///
29 | public long Version { get; set; }
30 |
31 | ///
32 | /// Clones the current document.
33 | ///
34 | /// A clone of the current document.
35 | public Document Clone()
36 | {
37 | return new Document
38 | {
39 | Id = Id,
40 | Type = Type,
41 | Content = Content,
42 | Version = Version
43 | };
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/IAccessor.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql
2 | {
3 | ///
4 | /// An implementation of this interface provides the accessors for the identifier of a
5 | /// document instance.
6 | ///
7 | /// The type of the value to get and set.
8 | public interface IAccessor
9 | {
10 | ///
11 | /// Gets a value of an object.
12 | ///
13 | /// The object to get the value from.
14 | /// The value of the object.
15 | T Get(object obj);
16 |
17 | ///
18 | /// Sets a value of an object.
19 | ///
20 | /// The object to set the value to.
21 | /// The value to set.
22 | void Set(object obj, T value);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/IAccessorFactory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace YesSql
4 | {
5 | ///
6 | /// This interface represents a component which can create
7 | /// an instance of in order to
8 | /// get or set a specific value of an object.
9 | ///
10 | public interface IAccessorFactory
11 | {
12 | ///
13 | /// Creates an instance.
14 | ///
15 | IAccessor CreateAccessor(Type tContainer);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/ICollection.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql
2 | {
3 | ///
4 | /// A class implementing this interface is associated to a collection.
5 | ///
6 | public interface ICollectionName
7 | {
8 | ///
9 | /// Gets the collection name.
10 | ///
11 | string Collection { get; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/ICommandInterpreter.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Text;
3 | using YesSql.Sql.Schema;
4 |
5 | namespace YesSql
6 | {
7 | ///
8 | /// A class implementing this interface can execute database commands.
9 | ///
10 | public interface ICommandInterpreter
11 | {
12 | IEnumerable CreateSql(IEnumerable commands);
13 | IEnumerable Run(ICreateTableCommand command);
14 | IEnumerable Run(IDropTableCommand command);
15 | IEnumerable Run(IAlterTableCommand command);
16 | void Run(StringBuilder builder, IAddColumnCommand command);
17 | void Run(StringBuilder builder, IDropColumnCommand command);
18 | void Run(StringBuilder builder, IAlterColumnCommand command);
19 | void Run(StringBuilder builder, IAddIndexCommand command);
20 | void Run(StringBuilder builder, IDropIndexCommand command);
21 | IEnumerable Run(ISqlStatementCommand command);
22 | IEnumerable Run(ICreateForeignKeyCommand command);
23 | IEnumerable Run(IDropForeignKeyCommand command);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/ICompiledQuery.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq.Expressions;
3 |
4 | namespace YesSql
5 | {
6 | ///
7 | /// And implementation of this interface can be reused
8 | /// to prevent multiple evaluations of the same expression
9 | /// tree.
10 | ///
11 | /// The type of object the query returns.
12 | public interface ICompiledQuery where T : class
13 | {
14 | Expression, IQuery>> Query();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/IConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data.Common;
3 |
4 | namespace YesSql
5 | {
6 | ///
7 | /// Represent a component capable of creating instances.
8 | ///
9 | public interface IConnectionFactory
10 | {
11 | ///
12 | /// Creates a instance.
13 | ///
14 | DbConnection CreateConnection();
15 |
16 | ///
17 | /// Gets the type of the connection is can create.
18 | ///
19 | Type DbConnectionType { get; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/IContentSerializer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace YesSql
4 | {
5 | ///
6 | /// This interface represents a components capable of serializing and deserializing
7 | /// an object.
8 | ///
9 | public interface IContentSerializer
10 | {
11 | ///
12 | /// Serializes an object into a .
13 | ///
14 | /// The object to serialize.
15 | /// The serialized object.
16 | string Serialize(object item);
17 |
18 | ///
19 | /// Deserializes an object from a string.
20 | ///
21 | /// The instance representing the object to deserialize.
22 | /// The type of the object to deserialize.
23 | /// The deserialized object.
24 | object Deserialize(string content, Type type);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/IIdGenerator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace YesSql
5 | {
6 | ///
7 | /// Represents a component that is able to generate unique identifiers for new documents.
8 | /// Any implementation must be thread-safe.
9 | ///
10 | public interface IIdGenerator
11 | {
12 | ///
13 | /// Invoked when the underlying store is created.
14 | ///
15 | /// The store that this instance is assigned to.
16 | Task InitializeAsync(IStore store);
17 |
18 | ///
19 | /// Initializes a document collection.
20 | ///
21 | Task InitializeCollectionAsync(IConfiguration configuration, string collection);
22 |
23 | ///
24 | /// Generates a unique identifier for the store.
25 | ///
26 | /// The name of the collection to generate the identifier for.
27 | /// A unique identifier
28 | [Obsolete($"Instead, utilize the {nameof(GetNextIdAsync)} method. This current method is slated for removal in upcoming releases.")]
29 | long GetNextId(string collection);
30 |
31 | ///
32 | /// Generates a unique identifier for the store.
33 | ///
34 | /// The name of the collection to generate the identifier for.
35 | /// A unique identifier
36 | Task GetNextIdAsync(string collection);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/ISqlBuilder.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace YesSql
4 | {
5 | ///
6 | /// A class implementing this interface is able to create custom SQL queries.
7 | ///
8 | public interface ISqlBuilder
9 | {
10 | string Clause { get; }
11 | Dictionary Parameters { get; }
12 | string FormatColumn(string table, string column, string schema, bool isAlias = false);
13 | string FormatTable(string table, string schema);
14 | string GetSelector();
15 | bool HasJoin { get; }
16 | bool HasOrder { get; }
17 | void ClearGroupBy();
18 | void ClearOrder();
19 | void OrderBy(string orderBy);
20 | void OrderByDescending(string orderBy);
21 | void OrderByRandom();
22 | void Select();
23 | void Selector(string selector);
24 | void Selector(string table, string column, string schema);
25 | void AddSelector(string select);
26 | void InsertSelector(string select);
27 | void Distinct();
28 | bool HasPaging { get; }
29 | void Skip(string skip);
30 | void Take(string take);
31 | void Table(string table, string alias, string schema);
32 | void From(string from);
33 | void ThenOrderBy(string orderBy);
34 | void ThenOrderByDescending(string orderBy);
35 | void ThenOrderByRandom();
36 | void Having(string having);
37 | void GroupBy(string groupBy);
38 | void Trail(string trail);
39 | void ClearTrail();
40 | string ToSqlString();
41 | void WhereAnd(string clause);
42 | void WhereOr(string clause);
43 | ISqlBuilder Clone();
44 | IEnumerable GetSelectors();
45 | IEnumerable GetOrders();
46 | void Join(JoinType type, string table, string onTable, string onColumn, string toTable, string toColumn, string schema, string alias = null, string toAlias = null);
47 | void HavingAnd(string having);
48 | void HavingOr(string having);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/ISqlFunction.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql
2 | {
3 | ///
4 | /// A class implementing this interface can be used to represent custom function calls in a dialect.
5 | ///
6 | public interface ISqlFunction
7 | {
8 |
9 | ///
10 | /// Renders the function.
11 | ///
12 | string Render(string[] arguments);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/IStore.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Threading.Tasks;
4 | using YesSql.Indexes;
5 |
6 | namespace YesSql
7 | {
8 | public interface IStore : IDisposable
9 | {
10 | ///
11 | /// Creates a new to communicate with the .
12 | ///
13 | ISession CreateSession(bool withTracking = true);
14 |
15 | ///
16 | /// Registers index providers.
17 | ///
18 | /// The index providers to register.
19 | /// The name of the collection.
20 | /// The instance.
21 | IStore RegisterIndexes(IEnumerable indexProviders, string collection = null);
22 |
23 | ///
24 | /// Returns the instance used to create this store.
25 | ///
26 | IConfiguration Configuration { get; }
27 |
28 | ///
29 | /// Initializes the database by creating the required tables and the default collection if necessary.
30 | ///
31 | Task InitializeAsync();
32 |
33 | ///
34 | /// Initializes a collection in the database by creating the required tables if necessary.
35 | ///
36 | Task InitializeCollectionAsync(string collection);
37 |
38 | ///
39 | /// Create an instance of containing descriptors for all indexes associated to a type and a collection.
40 | ///
41 | IEnumerable Describe(Type target, string collection = null);
42 |
43 | ///
44 | /// Returns the instance used to create this store.
45 | ///
46 | ITypeService TypeNames { get; }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/IStringBuilder.cs:
--------------------------------------------------------------------------------
1 | // Inspired from https://raw.githubusercontent.com/dotnet/runtime/59c592cc8d2778bcc6173baa2b25b13190e42990/src/libraries/Common/src/System/Text/ValueStringBuilder.cs
2 |
3 | using System;
4 |
5 | namespace YesSql
6 | {
7 | public interface IStringBuilder
8 | {
9 | ref char this[int index] { get; }
10 |
11 | int Capacity { get; }
12 | int Length { get; set; }
13 |
14 | void Append(ReadOnlySpan value);
15 | void Append(string s);
16 | ReadOnlySpan AsSpan();
17 | ReadOnlySpan AsSpan(int start);
18 | ReadOnlySpan AsSpan(int start, int length);
19 | void Clear();
20 | void EnsureCapacity(int capacity);
21 | void Insert(int index, char value, int count);
22 | void Insert(int index, string s);
23 | string ToString();
24 | bool TryCopyTo(Span destination, out int charsWritten);
25 | }
26 | }
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/ITableNameConvention.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace YesSql
4 | {
5 | ///
6 | /// A class implementing this interface can customize how table names are generated.
7 | ///
8 | public interface ITableNameConvention
9 | {
10 | ///
11 | /// Returns the name of a Document table.
12 | ///
13 | string GetDocumentTable(string collection = null);
14 |
15 | ///
16 | /// Returns the name of an Index table.
17 | ///
18 | string GetIndexTable(Type indexType, string collection = null);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/ITypeService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace YesSql
4 | {
5 | ///
6 | /// An implementation of this interface can provide a way to convert a string to a type.
7 | ///
8 | public interface ITypeService
9 | {
10 | ///
11 | /// Gets or sets the string representing a type.
12 | ///
13 | string this[Type t] { get; set; }
14 |
15 | ///
16 | /// Gets the type represented by a string.
17 | ///
18 | Type this[string s] { get; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/IdentityColumnSize.cs:
--------------------------------------------------------------------------------
1 | namespace YesSql
2 | {
3 | public enum IdentityColumnSize
4 | {
5 | Int32 = 1,
6 | Int64 = 2
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Indexes/DescribeContext.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | namespace YesSql.Indexes
6 | {
7 | public class DescribeContext : IDescriptor
8 | {
9 | private readonly Dictionary> _describes = new Dictionary>();
10 |
11 | public IEnumerable Describe(params Type[] types)
12 | {
13 | return _describes
14 | .Where(kp => types == null || types.Length == 0 || types.Contains(kp.Key))
15 | .SelectMany(x => x.Value)
16 | .Select(kp => new IndexDescriptor
17 | {
18 | Type = kp.IndexType,
19 | Map = kp.GetMap(),
20 | Reduce = kp.GetReduce(),
21 | Delete = kp.GetDelete(),
22 | GroupKey = kp.GroupProperty,
23 | IndexType = kp.IndexType,
24 | Filter = kp.Filter
25 | });
26 | }
27 |
28 | public IMapFor For() where TIndex : IIndex
29 | {
30 | return For();
31 | }
32 |
33 | public IMapFor For() where TIndex : IIndex
34 | {
35 | List descriptors;
36 |
37 | if (!_describes.TryGetValue(typeof(T), out descriptors))
38 | {
39 | descriptors = _describes[typeof(T)] = new List();
40 | }
41 |
42 | var describeFor = new IndexDescriptor();
43 | descriptors.Add(describeFor);
44 |
45 | return describeFor;
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Indexes/IDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace YesSql.Indexes
5 | {
6 | public interface IDescriptor
7 | {
8 | IEnumerable Describe(params Type[] types);
9 | }
10 | }
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Indexes/IIndex.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace YesSql.Indexes
4 | {
5 | public interface IIndex
6 | {
7 | long Id { get; set; }
8 | void AddDocument(Document document);
9 | void RemoveDocument(Document document);
10 | IEnumerable GetAddedDocuments();
11 | IEnumerable GetRemovedDocuments();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Indexes/IIndexProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace YesSql.Indexes
4 | {
5 | public interface IIndexProvider
6 | {
7 | void Describe(IDescriptor context);
8 | Type ForType();
9 | string CollectionName { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/YesSql.Abstractions/Indexes/IndexDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Reflection;
5 | using System.Threading.Tasks;
6 |
7 | namespace YesSql.Indexes
8 | {
9 | public class IndexDescriptor
10 | {
11 | public Type Type { get; set; }
12 | public Func