├── .gitignore
├── BuildProcessTemplates
├── DefaultTemplate.11.1.xaml
├── DefaultTemplate.xaml
├── LabDefaultTemplate.11.xaml
└── UpgradeTemplate.xaml
├── LICENSE
├── README
└── src
├── External Libraries
├── Log4Net 1.2
│ ├── log4net.dll
│ └── log4net.xml
└── Log4netCF
│ ├── log4net.dll
│ └── log4net.xml
├── ExternalFunction
├── AssemblyInfo.cs
├── ExternalFunction.csproj
├── ExternalFunction.csproj.vspscc
└── Simple.cs
├── Providertest
├── App.ico
├── AssemblyInfo.cs
├── Class1.cs
├── Providertest.csproj
└── Providertest.csproj.vspscc
├── SharpHSQL.sln
├── SharpHSQL.vssscc
├── SharpHSQL
├── Access.cs
├── AssemblyInfo.cs
├── ByteArray.cs
├── Cache.cs
├── CacheFree.cs
├── Channel.cs
├── Column.cs
├── Constraint.cs
├── Database.cs
├── DatabaseController.cs
├── DatabaseInformation.cs
├── Declare.cs
├── Enum.cs
├── Expression.cs
├── ExpressionType.cs
├── Function.cs
├── Index.cs
├── Library.cs
├── Like.cs
├── Logging
│ ├── EventLogHelper.cs
│ ├── Log.cs
│ ├── LogHelper.cs
│ └── TracingHelper.cs
├── Node.cs
├── Parsing
│ ├── Parser.cs
│ └── Tokenizer.cs
├── PocketSharpHSQL.csproj
├── PocketSharpHsql.csproj.vspscc
├── Provider_AdoNet
│ ├── CommandBuilder.cs
│ ├── CommandBuilderBehavior.cs
│ ├── SharpHsqlCommand.cs
│ ├── SharpHsqlCommandBuilder.cs
│ ├── SharpHsqlConnection.cs
│ ├── SharpHsqlConnectionString.cs
│ ├── SharpHsqlConnectionStringBuilder.cs
│ ├── SharpHsqlDataAdapter.cs
│ ├── SharpHsqlDbProviderFactory.cs
│ ├── SharpHsqlError.cs
│ ├── SharpHsqlErrorCollection.cs
│ ├── SharpHsqlEvents.cs
│ ├── SharpHsqlException.cs
│ ├── SharpHsqlParameter.cs
│ ├── SharpHsqlParameterCollection.cs
│ ├── SharpHsqlReader.cs
│ └── SharpHsqlTransaction.cs
├── Record.cs
├── ReflexHelper.cs
├── Result.cs
├── Row.cs
├── Select.cs
├── SharpHsql.csproj
├── SharpHsql.csproj.vspscc
├── StringConverter.cs
├── Table.cs
├── TableFilter.cs
├── Transaction.cs
├── Types
│ ├── AccessType.cs
│ ├── ColumnType.cs
│ ├── ConstraintType.cs
│ ├── ResultType.cs
│ ├── SelectType.cs
│ └── TokenType.cs
├── User.cs
└── doc
│ └── SharpHsql.xml
├── SharpHsql.Linq
├── App.config
├── DmlSqlGenerator.cs
├── ISharpHsqlSchemaExtensions.cs
├── MetadataHelpers.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Resources
│ ├── SQLiteProviderServices.StoreSchemaDefinition.ssdl
│ ├── SQLiteProviderServices.StoreSchemaMapping.msl
│ └── SharpHsqlProviderServices.ProviderManifest.xml
├── SQL_Generation
│ ├── ISqlFragment.cs
│ ├── InternalBase.cs
│ ├── JoinSymbol.cs
│ ├── KeyToListMap.cs
│ ├── SkipClause.cs
│ ├── SqlBuilder.cs
│ ├── SqlGenerator.cs
│ ├── SqlSelectStatement.cs
│ ├── SqlWriter.cs
│ ├── StringUtil.cs
│ ├── Symbol.cs
│ ├── SymbolPair.cs
│ ├── SymbolTable.cs
│ └── TopClause.cs
├── SharpHsql.Linq.csproj
├── SharpHsqlConvert.cs
├── SharpHsqlDateFormats.cs
├── SharpHsqlProviderManifest.cs
├── SharpHsqlProviderServices.cs
└── packages.config
├── hsqltest
├── App.ico
├── AssemblyInfo.cs
├── Class1.cs
├── hsqltest.csproj
└── hsqltest.csproj.vspscc
└── pocketSample
├── AssemblyInfo.cs
├── Form1.resx
├── form1.cs
├── pocketSample.csproj
└── pocketSample.csproj.vspscc
/.gitignore:
--------------------------------------------------------------------------------
1 | **/bin/
2 | **/obj/
3 | *.userprefs
4 |
--------------------------------------------------------------------------------
/BuildProcessTemplates/UpgradeTemplate.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | [New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly }]
21 |
22 |
23 |
24 | [Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.Auto]
25 | [False]
26 | [False]
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | [Microsoft.TeamFoundation.VersionControl.Client.RecursionType.OneLevel]
37 | [Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal]
38 |
39 |
40 |
41 | All
42 | Assembly references and imported namespaces serialized as XML namespaces
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | Small & embebdded database engine witten in C#.
2 | It is a port of the Hypersonic SQL v1.4 (HSQL) Java project
3 | and a continuation of the initial work done by Mark Tutt
4 | (http://www.codeproject.com/KB/database/sharphsql.aspx)
5 |
--------------------------------------------------------------------------------
/src/External Libraries/Log4Net 1.2/log4net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/External Libraries/Log4Net 1.2/log4net.dll
--------------------------------------------------------------------------------
/src/External Libraries/Log4netCF/log4net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/External Libraries/Log4netCF/log4net.dll
--------------------------------------------------------------------------------
/src/ExternalFunction/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 |
4 | //
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | //
9 | [assembly: AssemblyTitle("")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("")]
14 | [assembly: AssemblyCopyright("")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | //
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Revision and Build Numbers
27 | // by using the '*' as shown below:
28 |
29 | [assembly: AssemblyVersion("1.0.*")]
30 |
31 | //
32 | // In order to sign your assembly you must specify a key to use. Refer to the
33 | // Microsoft .NET Framework documentation for more information on assembly signing.
34 | //
35 | // Use the attributes below to control which key is used for signing.
36 | //
37 | // Notes:
38 | // (*) If no key is specified, the assembly is not signed.
39 | // (*) KeyName refers to a key that has been installed in the Crypto Service
40 | // Provider (CSP) on your machine. KeyFile refers to a file which contains
41 | // a key.
42 | // (*) If the KeyFile and the KeyName values are both specified, the
43 | // following processing occurs:
44 | // (1) If the KeyName can be found in the CSP, that key is used.
45 | // (2) If the KeyName does not exist and the KeyFile does exist, the key
46 | // in the KeyFile is installed into the CSP and used.
47 | // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
48 | // When specifying the KeyFile, the location of the KeyFile should be
49 | // relative to the project output directory which is
50 | // %Project Directory%\obj\. For example, if your KeyFile is
51 | // located in the project directory, you would specify the AssemblyKeyFile
52 | // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
53 | // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
54 | // documentation for more information on this.
55 | //
56 | [assembly: AssemblyDelaySign(false)]
57 | [assembly: AssemblyKeyFile("")]
58 | [assembly: AssemblyKeyName("")]
59 |
--------------------------------------------------------------------------------
/src/ExternalFunction/ExternalFunction.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Local
5 | {7E430EE6-B587-428A-9FB9-C1269A3FE4FD}
6 | Debug
7 | AnyCPU
8 |
9 |
10 | ExternalFunction
11 | JScript
12 | Grid
13 | IE50
14 | false
15 | Library
16 | ExternalFunction
17 | OnBuildSuccess
18 |
19 |
20 | 0.0
21 |
22 |
23 | SAK
24 | SAK
25 | SAK
26 | SAK
27 | http://localhost/ExternalFunction/
28 | true
29 | Web
30 | true
31 | Foreground
32 | 7
33 | Days
34 | false
35 | false
36 | true
37 | 0
38 | 1.0.0.%2a
39 | true
40 | false
41 | true
42 | v4.5
43 |
44 |
45 | bin\Debug\
46 | 285212672
47 |
48 |
49 | DEBUG;TRACE
50 | true
51 | 4096
52 | false
53 | false
54 | false
55 | 4
56 | full
57 | prompt
58 |
59 |
60 | bin\Release\
61 | 285212672
62 |
63 |
64 | TRACE
65 | 4096
66 | true
67 | false
68 | false
69 | 4
70 | none
71 | prompt
72 |
73 |
74 |
75 | System
76 |
77 |
78 | System.Data
79 |
80 |
81 |
82 |
83 |
84 | Code
85 |
86 |
87 | Code
88 |
89 |
90 |
91 |
92 | False
93 | .NET Framework 2.0 %28x86%29
94 | true
95 |
96 |
97 | False
98 | .NET Framework 3.0 %28x86%29
99 | false
100 |
101 |
102 | False
103 | .NET Framework 3.5
104 | false
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/src/ExternalFunction/ExternalFunction.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/src/ExternalFunction/Simple.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace ExternalFunction
4 | {
5 | ///
6 | /// Summary description for Simple.
7 | ///
8 | public class Simple
9 | {
10 | public Simple()
11 | {
12 | }
13 |
14 | public decimal calcrate( decimal amount, decimal percent )
15 | {
16 | return amount + ( amount * percent / 100 );
17 | }
18 |
19 | public static double tan( double value )
20 | {
21 | return Math.Tan( value );
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Providertest/App.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/Providertest/App.ico
--------------------------------------------------------------------------------
/src/Providertest/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 |
4 | //
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | //
9 | [assembly: AssemblyTitle("")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("")]
14 | [assembly: AssemblyCopyright("")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | //
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Revision and Build Numbers
27 | // by using the '*' as shown below:
28 |
29 | [assembly: AssemblyVersion("1.0.*")]
30 |
31 | //
32 | // In order to sign your assembly you must specify a key to use. Refer to the
33 | // Microsoft .NET Framework documentation for more information on assembly signing.
34 | //
35 | // Use the attributes below to control which key is used for signing.
36 | //
37 | // Notes:
38 | // (*) If no key is specified, the assembly is not signed.
39 | // (*) KeyName refers to a key that has been installed in the Crypto Service
40 | // Provider (CSP) on your machine. KeyFile refers to a file which contains
41 | // a key.
42 | // (*) If the KeyFile and the KeyName values are both specified, the
43 | // following processing occurs:
44 | // (1) If the KeyName can be found in the CSP, that key is used.
45 | // (2) If the KeyName does not exist and the KeyFile does exist, the key
46 | // in the KeyFile is installed into the CSP and used.
47 | // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
48 | // When specifying the KeyFile, the location of the KeyFile should be
49 | // relative to the project output directory which is
50 | // %Project Directory%\obj\. For example, if your KeyFile is
51 | // located in the project directory, you would specify the AssemblyKeyFile
52 | // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
53 | // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
54 | // documentation for more information on this.
55 | //
56 | [assembly: AssemblyDelaySign(false)]
57 | [assembly: AssemblyKeyFile("")]
58 | [assembly: AssemblyKeyName("")]
59 |
--------------------------------------------------------------------------------
/src/Providertest/Class1.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/Providertest/Class1.cs
--------------------------------------------------------------------------------
/src/Providertest/Providertest.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Local
5 | {8388AFBC-8E76-45B2-AA2D-F49A360747AE}
6 | Debug
7 | AnyCPU
8 | App.ico
9 |
10 |
11 | Providertest
12 | JScript
13 | Grid
14 | IE50
15 | false
16 | Exe
17 | Providertest
18 | OnBuildSuccess
19 |
20 |
21 | 0.0
22 |
23 |
24 | SAK
25 | SAK
26 | SAK
27 | SAK
28 | http://localhost/Providertest/
29 | true
30 | Web
31 | true
32 | Foreground
33 | 7
34 | Days
35 | false
36 | false
37 | true
38 | 0
39 | 1.0.0.%2a
40 | true
41 | false
42 | true
43 | v4.5
44 |
45 |
46 | bin\Debug\
47 | 285212672
48 |
49 |
50 | DEBUG;TRACE
51 | true
52 | 4096
53 | false
54 | false
55 | false
56 | 4
57 | full
58 | prompt
59 | true
60 |
61 |
62 | bin\Release\
63 | 285212672
64 |
65 |
66 | TRACE
67 | 4096
68 | true
69 | false
70 | false
71 | 4
72 | none
73 | prompt
74 |
75 |
76 |
77 | System
78 |
79 |
80 | System.Data
81 |
82 |
83 | System.XML
84 |
85 |
86 | ExternalFunction
87 | {7E430EE6-B587-428A-9FB9-C1269A3FE4FD}
88 |
89 |
90 | SharpHsql
91 | {B98F7374-FF00-4BB7-93EC-39763A76BFFF}
92 |
93 |
94 |
95 |
96 |
97 | Code
98 |
99 |
100 | Code
101 |
102 |
103 |
104 |
105 | False
106 | .NET Framework 2.0 %28x86%29
107 | true
108 |
109 |
110 | False
111 | .NET Framework 3.0 %28x86%29
112 | false
113 |
114 |
115 | False
116 | .NET Framework 3.5
117 | false
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/src/Providertest/Providertest.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/src/SharpHSQL.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpHsql", "SharpHSQL\SharpHsql.csproj", "{B98F7374-FF00-4BB7-93EC-39763A76BFFF}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "hsqltest", "hsqltest\hsqltest.csproj", "{264A06D6-76FB-4652-8619-9B651DF182D5}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Providertest", "Providertest\Providertest.csproj", "{8388AFBC-8E76-45B2-AA2D-F49A360747AE}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExternalFunction", "ExternalFunction\ExternalFunction.csproj", "{7E430EE6-B587-428A-9FB9-C1269A3FE4FD}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpHsql.Linq", "SharpHsql.Linq\SharpHsql.Linq.csproj", "{DEAFCB16-9BC4-4D3A-A850-C3B9423026C5}"
13 | EndProject
14 | Global
15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
16 | Debug|Any CPU = Debug|Any CPU
17 | Release|Any CPU = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {264A06D6-76FB-4652-8619-9B651DF182D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {264A06D6-76FB-4652-8619-9B651DF182D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {264A06D6-76FB-4652-8619-9B651DF182D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {264A06D6-76FB-4652-8619-9B651DF182D5}.Release|Any CPU.Build.0 = Release|Any CPU
24 | {7E430EE6-B587-428A-9FB9-C1269A3FE4FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {7E430EE6-B587-428A-9FB9-C1269A3FE4FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {7E430EE6-B587-428A-9FB9-C1269A3FE4FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {7E430EE6-B587-428A-9FB9-C1269A3FE4FD}.Release|Any CPU.Build.0 = Release|Any CPU
28 | {8388AFBC-8E76-45B2-AA2D-F49A360747AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29 | {8388AFBC-8E76-45B2-AA2D-F49A360747AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
30 | {8388AFBC-8E76-45B2-AA2D-F49A360747AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
31 | {8388AFBC-8E76-45B2-AA2D-F49A360747AE}.Release|Any CPU.Build.0 = Release|Any CPU
32 | {B98F7374-FF00-4BB7-93EC-39763A76BFFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {B98F7374-FF00-4BB7-93EC-39763A76BFFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {B98F7374-FF00-4BB7-93EC-39763A76BFFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {B98F7374-FF00-4BB7-93EC-39763A76BFFF}.Release|Any CPU.Build.0 = Release|Any CPU
36 | {DEAFCB16-9BC4-4D3A-A850-C3B9423026C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37 | {DEAFCB16-9BC4-4D3A-A850-C3B9423026C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
38 | {DEAFCB16-9BC4-4D3A-A850-C3B9423026C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
39 | {DEAFCB16-9BC4-4D3A-A850-C3B9423026C5}.Release|Any CPU.Build.0 = Release|Any CPU
40 | EndGlobalSection
41 | GlobalSection(MonoDevelopProperties) = preSolution
42 | Policies = $0
43 | $0.TextStylePolicy = $1
44 | $1.inheritsSet = null
45 | $1.scope = text/x-csharp
46 | $0.CSharpFormattingPolicy = $2
47 | $2.AfterDelegateDeclarationParameterComma = True
48 | $2.inheritsSet = Mono
49 | $2.inheritsScope = text/x-csharp
50 | $2.scope = text/x-csharp
51 | $0.TextStylePolicy = $3
52 | $3.FileWidth = 120
53 | $3.TabsToSpaces = False
54 | $3.RemoveTrailingWhitespace = False
55 | $3.EolMarker = Windows
56 | $3.inheritsSet = VisualStudio
57 | $3.inheritsScope = text/plain
58 | $3.scope = text/plain
59 | $0.TextStylePolicy = $4
60 | $4.inheritsSet = null
61 | $4.scope = application/config+xml
62 | $0.XmlFormattingPolicy = $5
63 | $5.inheritsSet = null
64 | $5.scope = application/config+xml
65 | $0.TextStylePolicy = $6
66 | $6.inheritsSet = null
67 | $6.scope = application/xml
68 | $0.XmlFormattingPolicy = $7
69 | $7.inheritsSet = Mono
70 | $7.inheritsScope = application/xml
71 | $7.scope = application/xml
72 | $0.TextStylePolicy = $8
73 | $8.inheritsSet = null
74 | $8.scope = text/microsoft-resx
75 | $0.XmlFormattingPolicy = $9
76 | $9.inheritsSet = null
77 | $9.scope = text/microsoft-resx
78 | $0.StandardHeader = $10
79 | $10.Text =
80 | $10.IncludeInNewFiles = True
81 | EndGlobalSection
82 | GlobalSection(TeamFoundationVersionControl) = preSolution
83 | SccNumberOfProjects = 7
84 | SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
85 | SccTeamFoundationServer = https://tfs07.codeplex.com/
86 | SccLocalPath0 = .
87 | SccProjectUniqueName1 = ExternalFunction\\ExternalFunction.csproj
88 | SccProjectName1 = ExternalFunction
89 | SccLocalPath1 = ExternalFunction
90 | SccProjectUniqueName2 = hsqltest\\hsqltest.csproj
91 | SccProjectName2 = hsqltest
92 | SccLocalPath2 = hsqltest
93 | SccProjectUniqueName3 = pocketSample\\pocketSample.csproj
94 | SccProjectName3 = pocketSample
95 | SccLocalPath3 = pocketSample
96 | SccProjectUniqueName4 = Providertest\\Providertest.csproj
97 | SccProjectName4 = Providertest
98 | SccLocalPath4 = Providertest
99 | SccProjectUniqueName5 = SharpHSQL\\PocketSharpHsql.csproj
100 | SccProjectName5 = SharpHSQL
101 | SccLocalPath5 = SharpHSQL
102 | SccProjectUniqueName6 = SharpHSQL\\SharpHsql.csproj
103 | SccProjectName6 = SharpHSQL
104 | SccLocalPath6 = SharpHSQL
105 | EndGlobalSection
106 | GlobalSection(SolutionProperties) = preSolution
107 | HideSolutionNode = FALSE
108 | EndGlobalSection
109 | GlobalSection(DPCodeReviewSolutionGUID) = preSolution
110 | DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
111 | EndGlobalSection
112 | EndGlobal
113 |
--------------------------------------------------------------------------------
/src/SharpHSQL.vssscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
10 | }
11 |
--------------------------------------------------------------------------------
/src/SharpHSQL/Access.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Access.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Runtime.InteropServices;
4 | using System.Runtime.CompilerServices;
5 |
6 | //
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | //
11 | [assembly: AssemblyTitle("SharpHSQL")]
12 | [assembly: AssemblyDescription("C# port of Java HSQLDB")]
13 | #if DEBUG
14 | [assembly: AssemblyConfiguration("DEBUG")]
15 | #else
16 | [assembly: AssemblyConfiguration("RELEASE")]
17 | #endif
18 | [assembly: AssemblyCompany("")]
19 | [assembly: AssemblyProduct("SharpHSQL")]
20 | [assembly: AssemblyCopyright("Mark Tutt")]
21 | [assembly: AssemblyTrademark("")]
22 | [assembly: AssemblyCulture("")]
23 |
24 | //
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Revision
30 | // Build Number
31 | //
32 | // You can specify all the value or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 |
35 | [assembly: AssemblyVersion("4.0.1.0")]
36 | #if !POCKETPC
37 | [assembly: AssemblyFileVersion("4.0.1.0")]
38 | #endif
39 | //
40 | // In order to sign your assembly you must specify a key to use. Refer to the
41 | // Microsoft .NET Framework documentation for more information on assembly signing.
42 | //
43 | // Use the attributes below to control which key is used for signing.
44 | //
45 | // Notes:
46 | // (*) If no key is specified - the assembly cannot be signed.
47 | // (*) KeyName refers to a key that has been installed in the Crypto Service
48 | // Provider (CSP) on your machine.
49 | // (*) If the key file and a key name attributes are both specified, the
50 | // following processing occurs:
51 | // (1) If the KeyName can be found in the CSP - that key is used.
52 | // (2) If the KeyName does not exist and the KeyFile does exist, the key
53 | // in the file is installed into the CSP and used.
54 | // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
55 | // documentation for more information on this.
56 | //
57 | [assembly: ComVisible(false)]
58 | [assembly: CLSCompliant(true)]
59 |
60 |
--------------------------------------------------------------------------------
/src/SharpHSQL/ByteArray.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/ByteArray.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Cache.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Cache.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/CacheFree.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/CacheFree.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Channel.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Channel.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Column.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Column.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Constraint.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Constraint.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Database.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Database.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/DatabaseController.cs:
--------------------------------------------------------------------------------
1 | #region Usings
2 | using System;
3 | using System.Collections;
4 | using System.Reflection;
5 | using System.Threading;
6 | #endregion
7 |
8 | namespace SharpHsql
9 | {
10 | ///
11 | /// Controller class for single point database access.
12 | ///
13 | public sealed class DatabaseController
14 | {
15 | private static object SyncRoot = new object();
16 | private static Hashtable _dbs = Hashtable.Synchronized( new Hashtable() );
17 | private static Timer _checkPoint;
18 |
19 | private DatabaseController(){}
20 |
21 | static DatabaseController()
22 | {
23 | try
24 | {
25 | // try to shutdown gracefully when process exits
26 | #if !POCKETPC
27 | AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit);
28 | #endif
29 |
30 | // do a checkpoint every minute
31 | _checkPoint = new Timer( new TimerCallback(DoCheckPoint), null, 60000, 60000);
32 | }
33 | catch( Exception ex )
34 | {
35 | LogHelper.Publish( "Unexpected exception on [DatabaseController] constructor.", ex );
36 | }
37 | }
38 |
39 | ///
40 | /// Gets a instance by name.
41 | ///
42 | ///
43 | /// This class mantains a cache of already created database
44 | /// objects to prevent opening the same database more than once,
45 | /// because database files are open exclusively.
46 | ///
47 | /// Database full path.
48 | /// A reference of a new or existing database object.
49 | public static Database GetDatabase(string name)
50 | {
51 | lock( SyncRoot )
52 | {
53 | try
54 | {
55 | Database db = null;
56 | if( _dbs.ContainsKey( name ) )
57 | {
58 | db = (Database)_dbs[name];
59 | }
60 | else
61 | {
62 | db = new Database(name);
63 | _dbs.Add(name, db);
64 | }
65 | return db;
66 | }
67 | catch( Exception ex )
68 | {
69 | LogHelper.Publish( String.Format("Unexpected exception on [GetDatabase] method for database {0}.", name ), ex );
70 |
71 | throw;
72 | }
73 | }
74 | }
75 |
76 | ///
77 | /// Shutdown an already open database.
78 | ///
79 | /// The name of the database.
80 | public static void Shutdown( string name )
81 | {
82 | lock( SyncRoot )
83 | {
84 | try
85 | {
86 | Database db = _dbs[name] as Database;
87 | if( db != null )
88 | {
89 | lock( db )
90 | {
91 | db.Execute("SHUTDOWN", db.SysChannel );
92 | }
93 | _dbs.Remove( name );
94 | }
95 | }
96 | catch( Exception ex )
97 | {
98 | LogHelper.Publish( String.Format("Unexpected exception on [Shutdown] method for database {0}.", name ), ex );
99 |
100 | throw;
101 | }
102 | }
103 | }
104 |
105 | ///
106 | /// Shut down all active database instances.
107 | ///
108 | public static void ShutdownAll()
109 | {
110 | lock( SyncRoot )
111 | {
112 | try
113 | {
114 | object[] keys = new object[_dbs.Keys.Count];
115 | _dbs.Keys.CopyTo( keys, 0 );
116 | foreach( string name in keys )
117 | {
118 | Database db = _dbs[name] as Database;
119 | if( db != null )
120 | {
121 | lock( db )
122 | {
123 | db.Execute("SHUTDOWN", db.SysChannel);
124 | }
125 | _dbs.Remove( name );
126 | }
127 | }
128 | }
129 | catch( Exception ex )
130 | {
131 | LogHelper.Publish( "Unexpected exception on [ShutdownAll] method.", ex );
132 |
133 | throw;
134 | }
135 | }
136 | }
137 |
138 | private static void CurrentDomain_ProcessExit(object sender, EventArgs e)
139 | {
140 | try
141 | {
142 | // disable timer
143 | _checkPoint.Change(-1, -1);
144 | _checkPoint.Dispose();
145 | _checkPoint = null;
146 |
147 | ShutdownAll();
148 | }
149 | catch{}
150 | }
151 |
152 | private static void DoCheckPoint( object state )
153 | {
154 | lock( SyncRoot )
155 | {
156 | try
157 | {
158 | // disable timer
159 | _checkPoint.Change(-1, -1);
160 |
161 | // do a checkpoint an all open databases
162 | object[] keys = new object[_dbs.Keys.Count];
163 | _dbs.Keys.CopyTo( keys, 0 );
164 | foreach( string name in keys )
165 | {
166 | Database db = _dbs[name] as Database;
167 | if( db != null )
168 | {
169 | try
170 | {
171 | lock( db )
172 | {
173 | db.Execute("CHECKPOINT", db.SysChannel);
174 | }
175 | }
176 | catch( Exception e )
177 | {
178 | LogHelper.Publish( String.Format("Unexpected exception executing CHECKPOINT statement on database {0}.", db.Name ), e );
179 |
180 | db.Log.Write( db.SysChannel, "Error on CHECKPOINT: " + e.Message );
181 | }
182 | }
183 | }
184 | }
185 | catch( Exception ex )
186 | {
187 | LogHelper.Publish( "Unexpected exception on [DoCheckPoint] method.", ex );
188 | }
189 | finally
190 | {
191 | // re-enable checkpoint
192 | if( _checkPoint != null )
193 | _checkPoint.Change( 60000, 60000 );
194 | }
195 | }
196 | }
197 | }
198 | }
199 |
--------------------------------------------------------------------------------
/src/SharpHSQL/DatabaseInformation.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/DatabaseInformation.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Declare.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Declare.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Expression.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Expression.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/ExpressionType.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/ExpressionType.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Function.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Function.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Index.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Index.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Library.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Library.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Like.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Like.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Logging/EventLogHelper.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Logging/EventLogHelper.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Logging/Log.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Logging/Log.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Logging/LogHelper.cs:
--------------------------------------------------------------------------------
1 | #region using
2 | using System;
3 | using System.Text;
4 | using System.Collections;
5 | using System.Collections.Specialized;
6 | using System.Diagnostics;
7 | using System.Reflection;
8 | using System.Security;
9 | using System.Security.Permissions;
10 | using System.IO;
11 | #endregion
12 |
13 | namespace SharpHsql
14 | {
15 | ///
16 | /// Specifies the event type of an log entry.
17 | ///
18 | ///
19 | /// The type of an log entry is used to indicate the severity of a log entry.
20 | /// Each log must be of a single type, which the application indicates when it reports the log.
21 | ///
22 | public enum LogEntryType
23 | {
24 | ///
25 | /// An audit log. This indicates a successful audit.
26 | ///
27 | Audit,
28 | ///
29 | /// A debug log. This is for testing and debugging operations.
30 | ///
31 | Debug,
32 | ///
33 | /// An information log. This indicates a significant, successful operation.
34 | ///
35 | Information,
36 | ///
37 | /// A warning log.
38 | /// This indicates a problem that is not immediately significant,
39 | /// but that may signify conditions that could cause future problems.
40 | ///
41 | Warning,
42 | ///
43 | /// An error log.
44 | /// This indicates a significant problem the user should know about;
45 | /// usually a loss of functionality or data.
46 | ///
47 | Error,
48 | ///
49 | /// An fatal log.
50 | /// This indicates a fatal problem the user should know about;
51 | /// allways a loss of functionality or data.
52 | ///
53 | Fatal
54 | }
55 |
56 | class LogHelperBase
57 | {
58 | protected static void PublishInternal(string message, Exception exception, LogEntryType exceptionTpe)
59 | {
60 | Trace.WriteLine (message);
61 | }
62 | }
63 |
64 | internal class LogHelper : LogHelperBase
65 | {
66 | #region Publish
67 | ///
68 | /// Write Exception Info to the ILog interface.
69 | ///
70 | ///
71 | /// For Debugging or Information uses, its faster to use ILog
72 | /// interface directly, instead of this method.
73 | ///
74 | /// Additional exception info.
75 | public static void Publish(string message)
76 | {
77 | PublishInternal(message, null, LogEntryType.Information);
78 | }
79 |
80 | ///
81 | /// Write Exception Info to the ILog interface.
82 | ///
83 | /// Exception object.
84 | public static void Publish(Exception exception)
85 | {
86 | PublishInternal(null, exception, LogEntryType.Error);
87 | }
88 |
89 | ///
90 | /// Write Exception Info to the ILog interface.
91 | ///
92 | /// Exception object.
93 | /// See .
94 | public static void Publish(Exception exception, LogEntryType exceptionTpe)
95 | {
96 | PublishInternal(null, exception, exceptionTpe);
97 | }
98 |
99 | ///
100 | /// Write Exception Info to the ILog interface.
101 | ///
102 | ///
103 | /// For Debugging or Information uses, its faster to use ILog
104 | /// interface directly, instead of this method.
105 | ///
106 | /// Additional exception info.
107 | /// See .
108 | public static void Publish(string message, LogEntryType exceptionTpe)
109 | {
110 | PublishInternal(message, null, exceptionTpe);
111 | }
112 |
113 | ///
114 | /// Write Exception Info to the ILog interface.
115 | ///
116 | /// Additional exception info.
117 | /// Exception object.
118 | public static void Publish(string message, Exception exception)
119 | {
120 | PublishInternal(message, exception, LogEntryType.Error);
121 | }
122 |
123 | ///
124 | /// Write Exception Info to the ILog interface.
125 | ///
126 | /// Additional exception info.
127 | /// Exception object.
128 | /// See .
129 | public static void Publish(string message, Exception exception, LogEntryType exceptionTpe)
130 | {
131 | PublishInternal(message, exception, exceptionTpe);
132 | }
133 |
134 | #endregion
135 | }
136 | }
--------------------------------------------------------------------------------
/src/SharpHSQL/Logging/TracingHelper.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Logging/TracingHelper.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Node.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Node.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Parsing/Parser.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Parsing/Parser.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Parsing/Tokenizer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Parsing/Tokenizer.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/PocketSharpHSQL.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Local
5 | {B1247008-F987-4C90-9EA1-A8FA1EDA3799}
6 | Debug
7 | AnyCPU
8 | {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
9 |
10 |
11 |
12 |
13 | PocketSharpHsql
14 | KeyPair.snk
15 | true
16 | Library
17 | \Program Files\PocketSharpHSQL
18 | SharpHsql
19 |
20 |
21 |
22 |
23 | 4.20
24 | 0.0
25 | Pocket PC 2003
26 |
27 |
28 |
29 |
30 | true
31 | SAK
32 | SAK
33 | SAK
34 | SAK
35 |
36 |
37 | 3C41C503-53EF-4c2a-8DD4-A8217CAD115E
38 | PocketPC
39 | $(AssemblyName)
40 | v2.0
41 |
42 |
43 | bincf\Debug\
44 | true
45 | 0
46 | false
47 |
48 |
49 | DEBUG;TRACE;POCKETPC;
50 | PocketSharpSQL.xml
51 | true
52 | 4096
53 | false
54 | false
55 | false
56 | false
57 | 4
58 | full
59 | true
60 | true
61 | off
62 |
63 |
64 | bincf\Release\
65 | true
66 | 0
67 | false
68 |
69 |
70 | POCKETPC;
71 | PocketSharpSQL.xml
72 | 4096
73 | true
74 | false
75 | false
76 | false
77 | 4
78 | none
79 | true
80 | true
81 | off
82 |
83 |
84 |
85 | MSCorLib
86 | False
87 |
88 |
89 | System
90 | False
91 |
92 |
93 |
94 | System.XML
95 | False
96 |
97 |
98 |
99 |
100 | Code
101 |
102 |
103 | Code
104 |
105 |
106 | Code
107 |
108 |
109 | Code
110 |
111 |
112 | Code
113 |
114 |
115 | Code
116 |
117 |
118 | Code
119 |
120 |
121 | Code
122 |
123 |
124 | Code
125 |
126 |
127 | Code
128 |
129 |
130 | Code
131 |
132 |
133 | Code
134 |
135 |
136 | Code
137 |
138 |
139 | Code
140 |
141 |
142 | Code
143 |
144 |
145 | Code
146 |
147 |
148 | Code
149 |
150 |
151 | Code
152 |
153 |
154 | Code
155 |
156 |
157 | Code
158 |
159 |
160 | Code
161 |
162 |
163 | Code
164 |
165 |
166 | Code
167 |
168 |
169 | Code
170 |
171 |
172 | Code
173 |
174 |
175 | Code
176 |
177 |
178 | Code
179 |
180 |
181 | Code
182 |
183 |
184 | Code
185 |
186 |
187 | Code
188 |
189 |
190 | Code
191 |
192 |
193 | Code
194 |
195 |
196 | Code
197 |
198 |
199 | Code
200 |
201 |
202 | Code
203 |
204 |
205 | Code
206 |
207 |
208 | Code
209 |
210 |
211 | Code
212 |
213 |
214 | Code
215 |
216 |
217 | Code
218 |
219 |
220 | Code
221 |
222 |
223 | Code
224 |
225 |
226 | Code
227 |
228 |
229 | Code
230 |
231 |
232 | Component
233 |
234 |
235 | Component
236 |
237 |
238 | Component
239 |
240 |
241 | Code
242 |
243 |
244 | Component
245 |
246 |
247 | Code
248 |
249 |
250 | Code
251 |
252 |
253 | Code
254 |
255 |
256 | Code
257 |
258 |
259 | Code
260 |
261 |
262 | Code
263 |
264 |
265 | Code
266 |
267 |
268 | Code
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
--------------------------------------------------------------------------------
/src/SharpHSQL/PocketSharpHsql.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/CommandBuilder.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/CommandBuilder.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/CommandBuilderBehavior.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/CommandBuilderBehavior.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlCommand.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/SharpHsqlCommand.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlCommandBuilder.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/SharpHsqlCommandBuilder.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlConnection.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/SharpHsqlConnection.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlConnectionString.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/SharpHsqlConnectionString.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlConnectionStringBuilder.cs:
--------------------------------------------------------------------------------
1 | #region Usings
2 | using System;
3 | using System.Data;
4 | using System.Data.Common;
5 | using System.Collections;
6 | using System.Collections.Specialized;
7 | using System.Globalization;
8 | #endregion
9 |
10 | #region License
11 | /*
12 | * SharpHsqlConnectionString.cs
13 | *
14 | * Copyright (c) 2004, Andres G Vettori
15 | * All rights reserved.
16 | *
17 | * Redistribution and use in source and binary forms, with or without
18 | * modification, are permitted provided that the following conditions are met:
19 | *
20 | * Redistributions of source code must retain the above copyright notice, this
21 | * list of conditions and the following disclaimer.
22 | *
23 | * Redistributions in binary form must reproduce the above copyright notice,
24 | * this list of conditions and the following disclaimer in the documentation
25 | * and/or other materials provided with the distribution.
26 | *
27 | * Neither the name of the HSQL Development Group nor the names of its
28 | * contributors may be used to endorse or promote products derived from this
29 | * software without specific prior written permission.
30 | *
31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
35 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
36 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
37 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
38 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
40 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 | *
42 | * This package is based on HypersonicSQL, originally developed by Thomas Mueller.
43 | *
44 | * C# SharpHsql ADO.NET Provider by Andrés G Vettori.
45 | * http://workspaces.gotdotnet.com/sharphsql
46 | */
47 | #endregion
48 |
49 | namespace System.Data.Hsql
50 | {
51 | ///
52 | /// Helper static class for building SharpHsql connection strings.
53 | ///
54 | internal sealed class SharpHsqlConnectionStringBuilder : DbConnectionStringBuilder
55 | {
56 | #region Constructors
57 |
58 | ///
59 | /// Static constructor.
60 | ///
61 | static SharpHsqlConnectionStringBuilder()
62 | {
63 | invariantComparer = CultureInfo.InvariantCulture.CompareInfo;
64 | }
65 |
66 | ///
67 | /// Creates a new object
68 | /// using a connection string.
69 | ///
70 | ///
71 | internal SharpHsqlConnectionStringBuilder( string connstring )
72 | {
73 | if( connstring == null || connstring.Length == 0 || connstring.Trim().Length == 0 )
74 | throw new ArgumentNullException("connstring");
75 |
76 | string[] pairs = connstring.Split(';');
77 |
78 | if( pairs.Length < 3 )
79 | throw new ArgumentException("The connection string is invalid.", "connstring");
80 |
81 | for( int i=0;i
125 | /// Returns the connection string built.
126 | ///
127 | ///
128 | public override string ToString()
129 | {
130 | return _connstring;
131 | }
132 |
133 | #endregion
134 |
135 | #region Public Fields
136 |
137 | ///
138 | /// Database name.
139 | ///
140 | public string Database = String.Empty;
141 | ///
142 | /// User name.
143 | ///
144 | public string UserName = String.Empty;
145 | ///
146 | /// User password.
147 | ///
148 | public string UserPassword = String.Empty;
149 |
150 | #endregion
151 |
152 | #region Internal Vars
153 |
154 | ///
155 | /// Class used internally for comparisons.
156 | ///
157 | internal static CompareInfo invariantComparer;
158 |
159 | #endregion
160 |
161 | #region Internal String Constants
162 |
163 | internal const string Initial_Catalog = "initial catalog";
164 | internal const string DB = "database";
165 | internal const string User_ID = "user id";
166 | internal const string UID = "uid";
167 | internal const string Pwd = "pwd";
168 | internal const string Password = "password";
169 |
170 | #endregion
171 |
172 | #region Private Vars
173 |
174 | private string _connstring = String.Empty;
175 |
176 | #endregion
177 | }
178 | }
179 |
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlDataAdapter.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/SharpHsqlDataAdapter.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlDbProviderFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 |
3 | namespace System.Data.Hsql
4 | {
5 | using System.Data.Common;
6 |
7 | ///
8 | /// Sharp hsql db provider factory.
9 | ///
10 | public class SharpHsqlDbProviderFactory : DbProviderFactory
11 | {
12 | ///
13 | /// Static instance member which returns an instanced SharpHsqlFactory class.
14 | ///
15 | public static readonly SharpHsqlDbProviderFactory Instance = new SharpHsqlDbProviderFactory();
16 |
17 | public SharpHsqlDbProviderFactory()
18 | {
19 | Trace.WriteLine ("SharpHsqlDbProviderFactory.ctor()");
20 | }
21 | ///
22 | /// Returns a new SharpHsqlCommand object.
23 | ///
24 | /// A SharpHsqlCommand object.
25 | public override DbCommand CreateCommand()
26 | {
27 | return new SharpHsqlCommand();
28 | }
29 | ///
30 | /// Returns a new SharpHsqlCommandBuilder object.
31 | ///
32 | /// A SharpHsqlCommandBuilder object.
33 | public override DbCommandBuilder CreateCommandBuilder()
34 | {
35 | return new SharpHsqlCommandBuilder();
36 | }
37 | ///
38 | /// Creates a new SharpHsqlConnection.
39 | ///
40 | /// A SharpHsqlConnection object.
41 | public override DbConnection CreateConnection()
42 | {
43 | return new SharpHsqlConnection();
44 | }
45 |
46 | ///
47 | /// Creates a new SharpHsqlConnectionStringBuilder.
48 | ///
49 | /// A SharpHsqlConnectionStringBuilder object.
50 | public override DbConnectionStringBuilder CreateConnectionStringBuilder()
51 | {
52 | return new SharpHsqlConnectionStringBuilder(String.Empty);
53 | }
54 |
55 | ///
56 | /// Creates a new SharpHsqlDataAdapter.
57 | ///
58 | /// A SharpHsqlDataAdapter object.
59 | public override DbDataAdapter CreateDataAdapter()
60 | {
61 | return new SharpHsqlDataAdapter();
62 | }
63 |
64 | ///
65 | /// Creates a new SharpHsqlParameter.
66 | ///
67 | /// A SharpHsqlParameter object.
68 | public override DbParameter CreateParameter()
69 | {
70 | return new SharpHsqlParameter();
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlError.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/SharpHsqlError.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlErrorCollection.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/SharpHsqlErrorCollection.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlEvents.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/SharpHsqlEvents.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlException.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/SharpHsqlException.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlParameter.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/SharpHsqlParameter.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlParameterCollection.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/SharpHsqlParameterCollection.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlReader.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/SharpHsqlReader.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Provider_AdoNet/SharpHsqlTransaction.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Provider_AdoNet/SharpHsqlTransaction.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Record.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Record.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/ReflexHelper.cs:
--------------------------------------------------------------------------------
1 | //===============================================================================
2 | // SharpHsql
3 | //
4 | // ReflexHelper.cs
5 | //
6 | // This file contains the implementations of reflection utility methods.
7 | //
8 | //===============================================================================
9 |
10 | using System;
11 | using System.Collections;
12 | using System.Diagnostics;
13 | using System.IO;
14 | using System.Reflection;
15 | using System.Security.Permissions;
16 | using System.Threading;
17 | using System.Globalization;
18 |
19 | namespace SharpHsql
20 | {
21 | ///
22 | /// Provides utility methods for reflection-related operations.
23 | ///
24 | sealed class ReflexHelper
25 | {
26 | #if !POCKETPC
27 | ///
28 | /// Gets the Assembly Configuration Attribute.
29 | ///
30 | /// Assembly to get configuration.
31 | ///
32 | public static string GetAssemblyConfiguration(Assembly assembly)
33 | {
34 | object [] att = assembly.GetCustomAttributes(typeof(AssemblyConfigurationAttribute), false);
35 | return ((att.Length > 0) ? ((AssemblyConfigurationAttribute) att [0]).Configuration : String.Empty);
36 | }
37 | #endif
38 |
39 | #if !POCKETPC
40 | ///
41 | /// Gets an assembly full path and file name.
42 | ///
43 | /// Assembly to get path.
44 | ///
45 | public static string GetAssemblyPath(Assembly assembly)
46 | {
47 | Uri uri = new Uri(assembly.CodeBase);
48 | return uri.LocalPath;
49 | }
50 | #endif
51 |
52 | #if !POCKETPC
53 | ///
54 | /// Gets the Assembly Title.
55 | ///
56 | /// Assembly to get title.
57 | ///
58 | public static string GetAssemblyTitle(Assembly assembly)
59 | {
60 | object [] att = assembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
61 | return ((att.Length > 0) ? ((AssemblyTitleAttribute) att [0]).Title : String.Empty);
62 | }
63 | #endif
64 |
65 | #if !POCKETPC
66 | ///
67 | /// Instructs a compiler to use a specific version number for the Win32 file version resource.
68 | /// The Win32 file version is not required to be the same as the assembly's version number.
69 | ///
70 | /// Assembly to get version.
71 | ///
72 | public static string GetAssemblyFileVersion(Assembly assembly)
73 | {
74 | object [] att = assembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false);
75 | return ((att.Length > 0) ? ((AssemblyFileVersionAttribute) att [0]).Version : String.Empty);
76 | }
77 | #endif
78 |
79 | #if !POCKETPC
80 | ///
81 | /// Gets the Assembly Product.
82 | ///
83 | /// Assembly to get product.
84 | ///
85 | public static string GetAssemblyProduct(Assembly assembly)
86 | {
87 | object [] att = assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false);
88 | return ((att.Length > 0) ? ((AssemblyProductAttribute) att [0]).Product : String.Empty);
89 | }
90 | #endif
91 | }
92 | }
--------------------------------------------------------------------------------
/src/SharpHSQL/Result.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Result.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Row.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Row.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Select.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Select.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/SharpHsql.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Local
5 | {B98F7374-FF00-4BB7-93EC-39763A76BFFF}
6 | Debug
7 | AnyCPU
8 |
9 |
10 | SharpHsql
11 | KeyPair.snk
12 | JScript
13 | Flow
14 | IE32Nav30
15 | false
16 | Library
17 | SharpHsql
18 | OnBuildSuccess
19 |
20 |
21 | 0.0
22 |
23 |
24 | http://localhost/SharpHsql/
25 | true
26 | Web
27 | true
28 | Foreground
29 | 7
30 | Days
31 | false
32 | false
33 | true
34 | 0
35 | 1.0.0.%2a
36 | true
37 | false
38 | true
39 | false
40 | SAK
41 | SAK
42 | SAK
43 | SAK
44 | v4.5
45 |
46 |
47 | bin\Debug\
48 | true
49 | 0
50 |
51 |
52 | DEBUG;TRACE
53 | doc\SharpHsql.xml
54 | true
55 | 4096
56 | false
57 | false
58 | false
59 | 4
60 | full
61 | prompt
62 |
63 |
64 | bin\Release\
65 | true
66 | 0
67 |
68 |
69 | doc\SharpHsql.xml
70 | 4096
71 | true
72 | false
73 | false
74 | 4
75 | none
76 | prompt
77 |
78 |
79 |
80 | mscorlib
81 |
82 |
83 | System
84 |
85 |
86 | System.Data
87 |
88 |
89 | System.XML
90 |
91 |
92 |
93 |
94 |
95 |
96 | Code
97 |
98 |
99 | Code
100 |
101 |
102 | Code
103 |
104 |
105 | Code
106 |
107 |
108 | Code
109 |
110 |
111 | Code
112 |
113 |
114 | Code
115 |
116 |
117 | Code
118 |
119 |
120 | Code
121 |
122 |
123 | Code
124 |
125 |
126 | Code
127 |
128 |
129 | Code
130 |
131 |
132 | Code
133 |
134 |
135 | Code
136 |
137 |
138 | Code
139 |
140 |
141 | Code
142 |
143 |
144 | Code
145 |
146 |
147 | Code
148 |
149 |
150 | Code
151 |
152 |
153 | Code
154 |
155 |
156 | Code
157 |
158 |
159 | Code
160 |
161 |
162 | Code
163 |
164 |
165 | Code
166 |
167 |
168 | Code
169 |
170 |
171 | Code
172 |
173 |
174 | Code
175 |
176 |
177 | Code
178 |
179 |
180 | Code
181 |
182 |
183 | Code
184 |
185 |
186 | Code
187 |
188 |
189 | Code
190 |
191 |
192 | Code
193 |
194 |
195 | Code
196 |
197 |
198 | Code
199 |
200 |
201 | Code
202 |
203 |
204 | Code
205 |
206 |
207 | Code
208 |
209 |
210 | Code
211 |
212 |
213 | Code
214 |
215 |
216 | Code
217 |
218 |
219 | Code
220 |
221 |
222 | Component
223 |
224 |
225 | Component
226 |
227 |
228 | Component
229 |
230 |
231 | Component
232 |
233 |
234 | Code
235 |
236 |
237 | Code
238 |
239 |
240 | Code
241 |
242 |
243 | Code
244 |
245 |
246 | Code
247 |
248 |
249 | Code
250 |
251 |
252 | Code
253 |
254 |
255 | Code
256 |
257 |
258 | Code
259 |
260 |
261 |
262 | Code
263 |
264 |
265 |
266 |
267 |
268 | False
269 | .NET Framework 2.0 %28x86%29
270 | true
271 |
272 |
273 | False
274 | .NET Framework 3.0 %28x86%29
275 | false
276 |
277 |
278 | False
279 | .NET Framework 3.5
280 | false
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
--------------------------------------------------------------------------------
/src/SharpHSQL/SharpHsql.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/src/SharpHSQL/StringConverter.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/StringConverter.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Table.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Table.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/TableFilter.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/TableFilter.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Transaction.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Transaction.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Types/AccessType.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Types/AccessType.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Types/ColumnType.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Types/ColumnType.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Types/ConstraintType.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Types/ConstraintType.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Types/ResultType.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Types/ResultType.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Types/SelectType.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Types/SelectType.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/Types/TokenType.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/Types/TokenType.cs
--------------------------------------------------------------------------------
/src/SharpHSQL/User.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ArsenShnurkov/SharpHSQL/a3340b985ced363e01855106517422345cacfa36/src/SharpHSQL/User.cs
--------------------------------------------------------------------------------
/src/SharpHsql.Linq/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/SharpHsql.Linq/ISharpHsqlSchemaExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace System.Data.Hsql.Linq
4 | {
5 | internal interface ISharpHsqlSchemaExtensions
6 | {
7 | void BuildTempSchema(SharpHsqlConnection cnn);
8 | }
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/src/SharpHsql.Linq/MetadataHelpers.cs:
--------------------------------------------------------------------------------
1 | namespace System.Data.Hsql.Linq
2 | {
3 | using System;
4 | using System.Data;
5 | using System.Collections.Generic;
6 | using System.Data.Entity.Core.Metadata.Edm;
7 | using System.Diagnostics;
8 |
9 | ///
10 | /// A set of static helpers for type metadata
11 | ///
12 | static class MetadataHelpers
13 | {
14 | #region Type Helpers
15 |
16 | ///
17 | /// Cast the EdmType of the given type usage to the given TEdmType
18 | ///
19 | ///
20 | ///
21 | ///
22 | internal static TEdmType GetEdmType(TypeUsage typeUsage)
23 | where TEdmType : EdmType
24 | {
25 | return (TEdmType)typeUsage.EdmType;
26 | }
27 |
28 | ///
29 | /// Gets the TypeUsage of the elment if the given type is a collection type
30 | ///
31 | ///
32 | ///
33 | internal static TypeUsage GetElementTypeUsage(TypeUsage type)
34 | {
35 | if (MetadataHelpers.IsCollectionType(type))
36 | {
37 | return ((CollectionType)type.EdmType).TypeUsage;
38 | }
39 | return null;
40 | }
41 |
42 | ///
43 | /// Retrieves the properties of in the EdmType underlying the input type usage,
44 | /// if that EdmType is a structured type (EntityType, RowType).
45 | ///
46 | ///
47 | ///
48 | internal static IList GetProperties(TypeUsage typeUsage)
49 | {
50 | return MetadataHelpers.GetProperties(typeUsage.EdmType);
51 | }
52 |
53 | ///
54 | /// Retrieves the properties of the given EdmType, if it is
55 | /// a structured type (EntityType, RowType).
56 | ///
57 | ///
58 | ///
59 | internal static IList GetProperties(EdmType edmType)
60 | {
61 | switch (edmType.BuiltInTypeKind)
62 | {
63 | case BuiltInTypeKind.ComplexType:
64 | return ((ComplexType)edmType).Properties;
65 | case BuiltInTypeKind.EntityType:
66 | return ((EntityType)edmType).Properties;
67 | case BuiltInTypeKind.RowType:
68 | return ((RowType)edmType).Properties;
69 | default:
70 | return new List();
71 | }
72 | }
73 |
74 | ///
75 | /// Is the given type usage over a collection type
76 | ///
77 | ///
78 | ///
79 | internal static bool IsCollectionType(TypeUsage typeUsage)
80 | {
81 | return MetadataHelpers.IsCollectionType(typeUsage.EdmType);
82 | }
83 |
84 | ///
85 | /// Is the given type a collection type
86 | ///
87 | ///
88 | ///
89 | internal static bool IsCollectionType(EdmType type)
90 | {
91 | return (BuiltInTypeKind.CollectionType == type.BuiltInTypeKind);
92 | }
93 |
94 | ///
95 | /// Is the given type usage over a primitive type
96 | ///
97 | ///
98 | ///
99 | internal static bool IsPrimitiveType(TypeUsage type)
100 | {
101 | return MetadataHelpers.IsPrimitiveType(type.EdmType);
102 | }
103 |
104 | ///
105 | /// Is the given type a primitive type
106 | ///
107 | ///
108 | ///
109 | internal static bool IsPrimitiveType(EdmType type)
110 | {
111 | return (BuiltInTypeKind.PrimitiveType == type.BuiltInTypeKind);
112 | }
113 |
114 | ///
115 | /// Is the given type usage over a row type
116 | ///
117 | ///
118 | ///
119 | internal static bool IsRowType(TypeUsage type)
120 | {
121 | return MetadataHelpers.IsRowType(type.EdmType);
122 | }
123 |
124 | ///
125 | /// Is the given type a row type
126 | ///
127 | ///
128 | ///
129 | internal static bool IsRowType(EdmType type)
130 | {
131 | return (BuiltInTypeKind.RowType == type.BuiltInTypeKind);
132 | }
133 |
134 | ///
135 | /// Gets the type of the given type usage if it is a primitive type
136 | ///
137 | ///
138 | ///
139 | ///
140 | internal static bool TryGetPrimitiveTypeKind(TypeUsage type, out PrimitiveTypeKind typeKind)
141 | {
142 | if (type != null && type.EdmType != null && type.EdmType.BuiltInTypeKind == BuiltInTypeKind.PrimitiveType)
143 | {
144 | typeKind = ((PrimitiveType)type.EdmType).PrimitiveTypeKind;
145 | return true;
146 | }
147 |
148 | typeKind = default(PrimitiveTypeKind);
149 | return false;
150 | }
151 |
152 | internal static PrimitiveTypeKind GetPrimitiveTypeKind(TypeUsage type)
153 | {
154 | PrimitiveTypeKind returnValue;
155 | if (!MetadataHelpers.TryGetPrimitiveTypeKind(type, out returnValue))
156 | {
157 | Debug.Assert(false, "Cannot create parameter of non-primitive type");
158 | throw new NotSupportedException("Cannot create parameter of non-primitive type");
159 | }
160 | return returnValue;
161 | }
162 |
163 | ///
164 | /// Gets the value for the metadata property with the given name
165 | ///
166 | ///
167 | ///
168 | ///
169 | ///
170 | internal static T TryGetValueForMetadataProperty(MetadataItem item, string propertyName)
171 | {
172 | MetadataProperty property;
173 | if (!item.MetadataProperties.TryGetValue(propertyName, true, out property))
174 | {
175 | return default(T);
176 | }
177 |
178 | return (T)property.Value;
179 | }
180 |
181 | internal static bool IsPrimitiveType(TypeUsage type, PrimitiveTypeKind primitiveType)
182 | {
183 | PrimitiveTypeKind typeKind;
184 | if (TryGetPrimitiveTypeKind(type, out typeKind))
185 | {
186 | return (typeKind == primitiveType);
187 | }
188 | return false;
189 | }
190 |
191 | internal static DbType GetDbType(PrimitiveTypeKind primitiveType)
192 | {
193 | switch (primitiveType)
194 | {
195 | case PrimitiveTypeKind.Binary: return DbType.Binary;
196 | case PrimitiveTypeKind.Boolean: return DbType.Boolean;
197 | case PrimitiveTypeKind.Byte: return DbType.Byte;
198 | case PrimitiveTypeKind.DateTime: return DbType.DateTime;
199 | case PrimitiveTypeKind.Decimal: return DbType.Decimal;
200 | case PrimitiveTypeKind.Double: return DbType.Double;
201 | case PrimitiveTypeKind.Single: return DbType.Single;
202 | case PrimitiveTypeKind.Guid: return DbType.Guid;
203 | case PrimitiveTypeKind.Int16: return DbType.Int16;
204 | case PrimitiveTypeKind.Int32: return DbType.Int32;
205 | case PrimitiveTypeKind.Int64: return DbType.Int64;
206 | //case PrimitiveTypeKind.Money: return DbType.Decimal;
207 | case PrimitiveTypeKind.SByte: return DbType.SByte;
208 | case PrimitiveTypeKind.String: return DbType.String;
209 | //case PrimitiveTypeKind.UInt16: return DbType.UInt16;
210 | //case PrimitiveTypeKind.UInt32: return DbType.UInt32;
211 | //case PrimitiveTypeKind.UInt64: return DbType.UInt64;
212 | //case PrimitiveTypeKind.Xml: return DbType.Xml;
213 | default:
214 | Debug.Fail("unknown PrimitiveTypeKind" + primitiveType.ToString());
215 | throw new InvalidOperationException(string.Format("Unknown PrimitiveTypeKind {0}", primitiveType));
216 | }
217 | }
218 |
219 | #endregion
220 |
221 | #region Facet Support
222 | internal static readonly int UnicodeStringMaxMaxLength = Int32.MaxValue;
223 | internal static readonly int AsciiStringMaxMaxLength = Int32.MaxValue;
224 | internal static readonly int BinaryMaxMaxLength = Int32.MaxValue;
225 |
226 | #region Facet Names
227 | ///
228 | /// Name of the MaxLength Facet
229 | ///
230 | public static readonly string MaxLengthFacetName = "MaxLength";
231 |
232 | ///
233 | /// Name of the Unicode Facet
234 | ///
235 | public static readonly string UnicodeFacetName = "Unicode";
236 |
237 | ///
238 | /// Name of the FixedLength Facet
239 | ///
240 | public static readonly string FixedLengthFacetName = "FixedLength";
241 |
242 | ///
243 | /// Name of the PreserveSeconds Facet
244 | ///
245 | public static readonly string PreserveSecondsFacetName = "PreserveSeconds";
246 |
247 | ///
248 | /// Name of the Precision Facet
249 | ///
250 | public static readonly string PrecisionFacetName = "Precision";
251 |
252 | ///
253 | /// Name of the Scale Facet
254 | ///
255 | public static readonly string ScaleFacetName = "Scale";
256 |
257 | ///
258 | /// Name of the DefaultValue Facet
259 | ///
260 | public static readonly string DefaultValueFacetName = "DefaultValue";
261 |
262 | ///
263 | /// Name of the Nullable Facet
264 | ///
265 | internal const string NullableFacetName = "Nullable";
266 | #endregion
267 |
268 | #region Facet Retreival Helpers
269 |
270 | ///
271 | /// Get the value specified on the given type usage for the given facet name.
272 | /// If the faces does not have a value specifid or that value is null returns
273 | /// the default value for that facet.
274 | ///
275 | ///
276 | ///
277 | ///
278 | ///
279 | ///
280 | internal static T GetFacetValueOrDefault(TypeUsage type, string facetName, T defaultValue)
281 | {
282 | //Get the value for the facet, if any
283 | Facet facet;
284 | if (type.Facets.TryGetValue(facetName, false, out facet) && facet.Value != null && !facet.IsUnbounded)
285 | {
286 | return (T)facet.Value;
287 | }
288 | else
289 | {
290 | return defaultValue;
291 | }
292 | }
293 |
294 | internal static bool IsFacetValueConstant(TypeUsage type, string facetName)
295 | {
296 | return MetadataHelpers.GetFacet(((PrimitiveType)type.EdmType).FacetDescriptions, facetName).IsConstant;
297 | }
298 |
299 | private static FacetDescription GetFacet(IEnumerable facetCollection, string facetName)
300 | {
301 | foreach (FacetDescription facetDescription in facetCollection)
302 | {
303 | if (facetDescription.FacetName == facetName)
304 | {
305 | return facetDescription;
306 | }
307 | }
308 |
309 | return null;
310 | }
311 |
312 | ///
313 | /// Given a facet name and an EdmType, tries to get that facet's description.
314 | ///
315 | ///
316 | ///
317 | ///
318 | ///
319 | internal static bool TryGetTypeFacetDescriptionByName(EdmType edmType, string facetName, out FacetDescription facetDescription)
320 | {
321 | facetDescription = null;
322 | if (MetadataHelpers.IsPrimitiveType(edmType))
323 | {
324 | PrimitiveType primitiveType = (PrimitiveType)edmType;
325 | foreach (FacetDescription fd in primitiveType.FacetDescriptions)
326 | {
327 | if (facetName.Equals(fd.FacetName, StringComparison.OrdinalIgnoreCase))
328 | {
329 | facetDescription = fd;
330 | return true;
331 | }
332 | }
333 | }
334 | return false;
335 | }
336 |
337 | internal static bool IsNullable(TypeUsage type)
338 | {
339 | Facet nullableFacet;
340 | if (type.Facets.TryGetValue(NullableFacetName, false, out nullableFacet))
341 | {
342 | return (bool)nullableFacet.Value;
343 | }
344 | return false;
345 | }
346 |
347 | internal static bool TryGetMaxLength(TypeUsage type, out int maxLength)
348 | {
349 | if (!IsPrimitiveType(type, PrimitiveTypeKind.String) &&
350 | !IsPrimitiveType(type, PrimitiveTypeKind.Binary))
351 | {
352 | maxLength = 0;
353 | return false;
354 | }
355 |
356 | // Binary and String FixedLength facets share the same name
357 | return TryGetIntFacetValue(type, MaxLengthFacetName, out maxLength);
358 | }
359 |
360 | internal static bool TryGetIntFacetValue(TypeUsage type, string facetName, out int intValue)
361 | {
362 | intValue = 0;
363 | Facet intFacet;
364 |
365 | if (type.Facets.TryGetValue(facetName, false, out intFacet) && intFacet.Value != null && !intFacet.IsUnbounded)
366 | {
367 | intValue = (int)intFacet.Value;
368 | return true;
369 | }
370 |
371 | return false;
372 | }
373 |
374 | internal static bool TryGetIsFixedLength(TypeUsage type, out bool isFixedLength)
375 | {
376 | if (!IsPrimitiveType(type, PrimitiveTypeKind.String) &&
377 | !IsPrimitiveType(type, PrimitiveTypeKind.Binary))
378 | {
379 | isFixedLength = false;
380 | return false;
381 | }
382 |
383 | // Binary and String MaxLength facets share the same name
384 | return TryGetBooleanFacetValue(type, FixedLengthFacetName, out isFixedLength);
385 | }
386 |
387 | internal static bool TryGetBooleanFacetValue(TypeUsage type, string facetName, out bool boolValue)
388 | {
389 | boolValue = false;
390 | Facet boolFacet;
391 | if (type.Facets.TryGetValue(facetName, false, out boolFacet) && boolFacet.Value != null)
392 | {
393 | boolValue = (bool)boolFacet.Value;
394 | return true;
395 | }
396 |
397 | return false;
398 | }
399 |
400 | internal static bool TryGetIsUnicode(TypeUsage type, out bool isUnicode)
401 | {
402 | if (!IsPrimitiveType(type, PrimitiveTypeKind.String))
403 | {
404 | isUnicode = false;
405 | return false;
406 | }
407 |
408 | return TryGetBooleanFacetValue(type, UnicodeFacetName, out isUnicode);
409 | }
410 |
411 | #endregion
412 |
413 | #endregion
414 |
415 | internal static bool IsCanonicalFunction(EdmFunction function)
416 | {
417 | return (function.NamespaceName == "Edm");
418 | }
419 |
420 | internal static bool IsStoreFunction(EdmFunction function)
421 | {
422 | return !IsCanonicalFunction(function);
423 | }
424 |
425 | // Returns ParameterDirection corresponding to given ParameterMode
426 | internal static ParameterDirection ParameterModeToParameterDirection(ParameterMode mode)
427 | {
428 | switch (mode)
429 | {
430 | case ParameterMode.In:
431 | return ParameterDirection.Input;
432 |
433 | case ParameterMode.InOut:
434 | return ParameterDirection.InputOutput;
435 |
436 | case ParameterMode.Out:
437 | return ParameterDirection.Output;
438 |
439 | case ParameterMode.ReturnValue:
440 | return ParameterDirection.ReturnValue;
441 |
442 | default:
443 | Debug.Fail("unrecognized mode " + mode.ToString());
444 | return default(ParameterDirection);
445 | }
446 | }
447 | }
448 | }
449 |
--------------------------------------------------------------------------------
/src/SharpHsql.Linq/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 |
4 | // Information about this assembly is defined by the following attributes.
5 | // Change them to the values specific to your project.
6 |
7 | [assembly: AssemblyTitle ("SharpHsql.Linq")]
8 | [assembly: AssemblyDescription ("")]
9 | [assembly: AssemblyConfiguration ("")]
10 | [assembly: AssemblyCompany ("")]
11 | [assembly: AssemblyProduct ("")]
12 | [assembly: AssemblyCopyright ("user")]
13 | [assembly: AssemblyTrademark ("")]
14 | [assembly: AssemblyCulture ("")]
15 |
16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
19 |
20 | [assembly: AssemblyVersion ("1.0.*")]
21 |
22 | // The following attributes are used to specify the signing key for the assembly,
23 | // if desired. See the Mono documentation for more information about signing.
24 |
25 | //[assembly: AssemblyDelaySign(false)]
26 | //[assembly: AssemblyKeyFile("")]
27 |
28 |
--------------------------------------------------------------------------------
/src/SharpHsql.Linq/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Mono Runtime Version: 4.0.30319.17020
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | // ------------------------------------------------------------------------------
10 |
11 | namespace Properties {
12 | using System;
13 |
14 |
15 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
16 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
17 | [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
18 | public class Resources {
19 |
20 | private static System.Resources.ResourceManager resourceMan;
21 |
22 | private static System.Globalization.CultureInfo resourceCulture;
23 |
24 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
25 | internal Resources() {
26 | }
27 |
28 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
29 | public static System.Resources.ResourceManager ResourceManager {
30 | get {
31 | if (object.Equals(null, resourceMan)) {
32 | System.Resources.ResourceManager temp = new System.Resources.ResourceManager("System.Data.Hsql.Linq.Resources", typeof(Resources).Assembly);
33 | resourceMan = temp;
34 | }
35 | return resourceMan;
36 | }
37 | }
38 |
39 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
40 | public static System.Globalization.CultureInfo Culture {
41 | get {
42 | return resourceCulture;
43 | }
44 | set {
45 | resourceCulture = value;
46 | }
47 | }
48 |
49 | public static string SQL_CONSTRAINTCOLUMNS {
50 | get {
51 | return ResourceManager.GetString("SQL_CONSTRAINTCOLUMNS", resourceCulture);
52 | }
53 | }
54 |
55 | public static string SQL_CONSTRAINTS {
56 | get {
57 | return ResourceManager.GetString("SQL_CONSTRAINTS", resourceCulture);
58 | }
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/SharpHsql.Linq/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | CREATE TEMP VIEW SCHEMACONSTRAINTCOLUMNS AS
123 | SELECT CONSTRAINT_CATALOG,
124 | NULL AS CONSTRAINT_SCHEMA,
125 | CONSTRAINT_NAME,
126 | TABLE_CATALOG,
127 | NULL AS TABLE_SCHEMA,
128 | TABLE_NAME,
129 | COLUMN_NAME
130 | FROM TEMP.SCHEMAINDEXCOLUMNS
131 | UNION
132 | SELECT CONSTRAINT_CATALOG,
133 | NULL,
134 | CONSTRAINT_NAME,
135 | TABLE_CATALOG,
136 | NULL,
137 | TABLE_NAME,
138 | FKEY_FROM_COLUMN
139 | FROM TEMP.SCHEMAFOREIGNKEYS;
140 |
141 |
142 |
143 |
144 | CREATE TEMP VIEW SCHEMACONSTRAINTS AS
145 | SELECT INDEX_CATALOG AS CONSTRAINT_CATALOG,
146 | NULL AS CONSTRAINT_SCHEMA,
147 | INDEX_NAME AS CONSTRAINT_NAME,
148 | TABLE_CATALOG,
149 | NULL AS TABLE_SCHEMA,
150 | TABLE_NAME,
151 | 'PRIMARY KEY' AS CONSTRAINT_TYPE,
152 | 0 AS IS_DEFERRABLE,
153 | 0 AS INITIALLY_DEFERRED,
154 | NULL AS CHECK_CLAUSE
155 | FROM TEMP.SCHEMAINDEXES
156 | WHERE PRIMARY_KEY = 1
157 | UNION
158 | SELECT INDEX_CATALOG,
159 | NULL,
160 | INDEX_NAME,
161 | TABLE_CATALOG,
162 | NULL,
163 | TABLE_NAME,
164 | 'UNIQUE',
165 | 0,
166 | 0,
167 | NULL
168 | FROM TEMP.SCHEMAINDEXES
169 | WHERE PRIMARY_KEY = 0 AND [UNIQUE] = 1
170 | UNION
171 | SELECT CONSTRAINT_CATALOG,
172 | NULL,
173 | CONSTRAINT_NAME,
174 | TABLE_CATALOG,
175 | NULL,
176 | TABLE_NAME,
177 | CONSTRAINT_TYPE,
178 | IS_DEFERRABLE,
179 | INITIALLY_DEFERRED,
180 | NULL
181 | FROM TEMP.SCHEMAFOREIGNKEYS;
182 |
183 |
184 |
185 |
--------------------------------------------------------------------------------
/src/SharpHsql.Linq/SQL_Generation/ISqlFragment.cs:
--------------------------------------------------------------------------------
1 | namespace System.Data.Hsql.Linq
2 | {
3 | using System.Data.Entity.Core.Common.CommandTrees;
4 |
5 | ///
6 | /// Represents the sql fragment for any node in the query tree.
7 | ///
8 | ///
9 | /// The nodes in a query tree produce various kinds of sql
10 | ///
11 | /// - A select statement.
12 | /// - A reference to an extent. (symbol)
13 | /// - A raw string.
14 | ///
15 | /// We have this interface to allow for a common return type for the methods
16 | /// in the expression visitor
17 | ///
18 | /// At the end of translation, the sql fragments are converted into real strings.
19 | ///
20 | internal interface ISqlFragment
21 | {
22 | ///
23 | /// Write the string represented by this fragment into the stream.
24 | ///
25 | /// The stream that collects the strings.
26 | /// Context information used for renaming.
27 | /// The global lists are used to generated new names without collisions.
28 | void WriteSql(SqlWriter writer, SqlGenerator sqlGenerator);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/SharpHsql.Linq/SQL_Generation/InternalBase.cs:
--------------------------------------------------------------------------------
1 | namespace System.Data.Hsql.Linq
2 | {
3 | using System.Text;
4 | #if NET_40 || NET_45
5 | using System.Runtime;
6 | #endif
7 |
8 | internal abstract class InternalBase
9 | {
10 | // Methods
11 | #if NET_40 || NET_45
12 | [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
13 | #endif
14 | protected InternalBase()
15 | {
16 | }
17 |
18 | internal abstract void ToCompactString(StringBuilder builder);
19 | internal virtual string ToFullString()
20 | {
21 | StringBuilder builder = new StringBuilder();
22 | this.ToFullString(builder);
23 | return builder.ToString();
24 | }
25 |
26 | #if NET_40 || NET_45
27 | [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
28 | #endif
29 | internal virtual void ToFullString(StringBuilder builder)
30 | {
31 | this.ToCompactString(builder);
32 | }
33 |
34 | public override string ToString()
35 | {
36 | StringBuilder builder = new StringBuilder();
37 | this.ToCompactString(builder);
38 | return builder.ToString();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/SharpHsql.Linq/SQL_Generation/JoinSymbol.cs:
--------------------------------------------------------------------------------
1 | namespace System.Data.Hsql.Linq
2 | {
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Data.Entity.Core.Metadata.Edm;
6 | using System.Data.Entity.Core.Common.CommandTrees;
7 |
8 | ///
9 | /// A Join symbol is a special kind of Symbol.
10 | /// It has to carry additional information
11 | ///
12 | /// - ColumnList for the list of columns in the select clause if this
13 | /// symbol represents a sql select statement. This is set by .
14 | /// - ExtentList is the list of extents in the select clause.
15 | /// - FlattenedExtentList - if the Join has multiple extents flattened at the
16 | /// top level, we need this information to ensure that extent aliases are renamed
17 | /// correctly in
18 | /// - NameToExtent has all the extents in ExtentList as a dictionary.
19 | /// This is used by to flatten
20 | /// record accesses.
21 | /// - IsNestedJoin - is used to determine whether a JoinSymbol is an
22 | /// ordinary join symbol, or one that has a corresponding SqlSelectStatement.
23 | ///
24 | ///
25 | /// All the lists are set exactly once, and then used for lookups/enumerated.
26 | ///
27 | internal sealed class JoinSymbol : Symbol
28 | {
29 | private List columnList;
30 | internal List ColumnList
31 | {
32 | get
33 | {
34 | if (null == columnList)
35 | {
36 | columnList = new List();
37 | }
38 | return columnList;
39 | }
40 | set { columnList = value; }
41 | }
42 |
43 | private List extentList;
44 | internal List ExtentList
45 | {
46 | get { return extentList; }
47 | }
48 |
49 | private List flattenedExtentList;
50 | internal List FlattenedExtentList
51 | {
52 | get
53 | {
54 | if (null == flattenedExtentList)
55 | {
56 | flattenedExtentList = new List();
57 | }
58 | return flattenedExtentList;
59 | }
60 | set { flattenedExtentList = value; }
61 | }
62 |
63 | private Dictionary nameToExtent;
64 | internal Dictionary NameToExtent
65 | {
66 | get { return nameToExtent; }
67 | }
68 |
69 | private bool isNestedJoin;
70 | internal bool IsNestedJoin
71 | {
72 | get { return isNestedJoin; }
73 | set { isNestedJoin = value; }
74 | }
75 |
76 | public JoinSymbol(string name, TypeUsage type, List extents)
77 | : base(name, type)
78 | {
79 | extentList = new List(extents.Count);
80 | nameToExtent = new Dictionary(extents.Count, StringComparer.OrdinalIgnoreCase);
81 | foreach (Symbol symbol in extents)
82 | {
83 | this.nameToExtent[symbol.Name] = symbol;
84 | this.ExtentList.Add(symbol);
85 | }
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/src/SharpHsql.Linq/SQL_Generation/KeyToListMap.cs:
--------------------------------------------------------------------------------
1 | namespace System.Data.Hsql.Linq
2 | {
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Collections.ObjectModel;
6 | using System.Collections;
7 |
8 | #if NET_40 || NET_45
9 | using System.Runtime;
10 | #endif
11 |
12 | internal sealed class KeyToListMap : InternalBase
13 | {
14 | // Fields
15 | private Dictionary> m_map;
16 |
17 | // Methods
18 | internal KeyToListMap(IEqualityComparer comparer)
19 | {
20 | this.m_map = new Dictionary>(comparer);
21 | }
22 |
23 | internal void Add(TKey key, TValue value)
24 | {
25 | List list;
26 | if (!this.m_map.TryGetValue(key, out list))
27 | {
28 | list = new List();
29 | this.m_map[key] = list;
30 | }
31 | list.Add(value);
32 | }
33 |
34 | internal void AddRange(TKey key, IEnumerable values)
35 | {
36 | foreach (TValue local in values)
37 | {
38 | this.Add(key, local);
39 | }
40 | }
41 |
42 | internal bool ContainsKey(TKey key)
43 | {
44 | return this.m_map.ContainsKey(key);
45 | }
46 |
47 | internal IEnumerable EnumerateValues(TKey key)
48 | {
49 | List values;
50 | if (m_map.TryGetValue(key, out values))
51 | {
52 | foreach (TValue value in values) { yield return value; }
53 | }
54 | }
55 |
56 | internal ReadOnlyCollection ListForKey(TKey key)
57 | {
58 | return new ReadOnlyCollection(this.m_map[key]);
59 | }
60 |
61 | internal bool RemoveKey(TKey key)
62 | {
63 | return this.m_map.Remove(key);
64 | }
65 |
66 | internal override void ToCompactString(StringBuilder builder)
67 | {
68 | foreach (TKey local in this.Keys)
69 | {
70 | StringUtil.FormatStringBuilder(builder, "{0}", new object[] { local });
71 | builder.Append(": ");
72 | IEnumerable list = this.ListForKey(local);
73 | StringUtil.ToSeparatedString(builder, list, ",", "null");
74 | builder.Append("; ");
75 | }
76 | }
77 |
78 | internal bool TryGetListForKey(TKey key, out ReadOnlyCollection valueCollection)
79 | {
80 | List list;
81 | valueCollection = null;
82 | if (this.m_map.TryGetValue(key, out list))
83 | {
84 | valueCollection = new ReadOnlyCollection(list);
85 | return true;
86 | }
87 | return false;
88 | }
89 |
90 | // Properties
91 | internal IEnumerable AllValues
92 | {
93 | get
94 | {
95 | foreach (TKey key in Keys)
96 | {
97 | foreach (TValue value in ListForKey(key))
98 | {
99 | yield return value;
100 | }
101 | }
102 | }
103 | }
104 |
105 | internal IEnumerable Keys
106 | {
107 | get
108 | {
109 | return this.m_map.Keys;
110 | }
111 | }
112 |
113 | internal IEnumerable>> KeyValuePairs
114 | {
115 | #if NET_40 || NET_45
116 | [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
117 | #endif
118 | get
119 | {
120 | return this.m_map;
121 | }
122 | }
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/src/SharpHsql.Linq/SQL_Generation/SkipClause.cs:
--------------------------------------------------------------------------------
1 | namespace System.Data.Hsql.Linq
2 | {
3 | using System.Globalization;
4 |
5 | ///
6 | /// SkipClause represents the a SKIP expression in a SqlSelectStatement.
7 | /// It has a count property, which indicates how many rows should be skipped.
8 | ///
9 | class SkipClause : ISqlFragment
10 | {
11 | ISqlFragment skipCount;
12 |
13 | ///
14 | /// How many rows should be skipped.
15 | ///
16 | internal ISqlFragment SkipCount
17 | {
18 | get { return skipCount; }
19 | }
20 |
21 | ///
22 | /// Creates a SkipClause with the given skipCount.
23 | ///
24 | ///
25 | internal SkipClause(ISqlFragment skipCount)
26 | {
27 | this.skipCount = skipCount;
28 | }
29 |
30 | ///
31 | /// Creates a SkipClause with the given skipCount.
32 | ///
33 | ///
34 | internal SkipClause(int skipCount)
35 | {
36 | SqlBuilder sqlBuilder = new SqlBuilder();
37 | sqlBuilder.Append(skipCount.ToString(CultureInfo.InvariantCulture));
38 | this.skipCount = sqlBuilder;
39 | }
40 |
41 | #region ISqlFragment Members
42 | ///
43 | /// Write out the SKIP part of sql select statement
44 | /// It basically writes OFFSET (X).
45 | ///
46 | ///
47 | ///
48 | public void WriteSql(SqlWriter writer, SqlGenerator sqlGenerator)
49 | {
50 | writer.Write(" OFFSET ");
51 | this.SkipCount.WriteSql(writer, sqlGenerator);
52 | }
53 | #endregion
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/SharpHsql.Linq/SQL_Generation/SqlBuilder.cs:
--------------------------------------------------------------------------------
1 | namespace System.Data.Hsql.Linq
2 | {
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Diagnostics;
6 | using System.Data.Entity.Core.Common.CommandTrees;
7 |
8 | ///
9 | /// This class is like StringBuilder. While traversing the tree for the first time,
10 | /// we do not know all the strings that need to be appended e.g. things that need to be
11 | /// renamed, nested select statements etc. So, we use a builder that can collect
12 | /// all kinds of sql fragments.
13 | ///
14 | internal sealed class SqlBuilder : ISqlFragment
15 | {
16 | private List