File tree Expand file tree Collapse file tree
Orm/Xtensive.Orm.Firebird/Sql.Drivers.Firebird Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,15 +68,12 @@ private static SqlDriver CreateDriverInstance(
6868 DefaultSchemaName = defaultSchema . Schema ,
6969 } ;
7070
71- if ( coreServerInfo . ServerVersion < new Version ( 2 , 5 ) ) {
72- throw new NotSupportedException ( Strings . ExFirebirdBelow25IsNotSupported ) ;
73- }
74-
75- if ( coreServerInfo . ServerVersion . Major == 2 && coreServerInfo . ServerVersion . Minor == 5 ) {
76- return new v2_5 . Driver ( coreServerInfo ) ;
77- }
78-
79- return null ;
71+ return coreServerInfo . ServerVersion switch {
72+ ( { Major : 2 } and { Minor : < 5 } ) or { Major : < 2 } => throw new NotSupportedException ( Strings . ExFirebirdBelow25IsNotSupported ) ,
73+ { Major : 2 } and { Minor : 5 } => new v2_5 . Driver ( coreServerInfo ) ,
74+ { Major : 4 } => new v4_0 . Driver ( coreServerInfo ) ,
75+ _ => throw new NotSupportedException ( )
76+ } ;
8077 }
8178
8279 /// <inheritdoc/>
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Text ;
4+
5+ namespace Xtensive . Sql . Drivers . Firebird . v4_0
6+ {
7+ internal class Compiler : v2_5 . Compiler
8+ {
9+ protected internal Compiler ( SqlDriver driver )
10+ : base ( driver )
11+ {
12+ }
13+ }
14+ }
Original file line number Diff line number Diff line change 1+ // Copyright (C) 2003-2010 Xtensive LLC.
2+ // All rights reserved.
3+ // For conditions of distribution and use, see license.
4+ // Created by: Csaba Beer
5+ // Created: 2011.01.10
6+
7+ using System ;
8+ using Xtensive . Sql . Info ;
9+ using Xtensive . Sql . Compiler ;
10+
11+ namespace Xtensive . Sql . Drivers . Firebird . v4_0
12+ {
13+ internal class Driver : v2_5 . Driver
14+ {
15+ protected override Sql . TypeMapper CreateTypeMapper ( )
16+ {
17+ return new TypeMapper ( this ) ;
18+ }
19+
20+ protected override SqlCompiler CreateCompiler ( )
21+ {
22+ return new Compiler ( this ) ;
23+ }
24+
25+ protected override SqlTranslator CreateTranslator ( )
26+ {
27+ return new Translator ( this ) ;
28+ }
29+
30+ protected override Model . Extractor CreateExtractor ( )
31+ {
32+ return new Extractor ( this ) ;
33+ }
34+
35+ protected override Info . ServerInfoProvider CreateServerInfoProvider ( )
36+ {
37+ return new ServerInfoProvider ( this ) ;
38+ }
39+
40+ // Constructors
41+
42+ public Driver ( CoreServerInfo coreServerInfo )
43+ : base ( coreServerInfo )
44+ {
45+ }
46+ }
47+ }
You can’t perform that action at this time.
0 commit comments