This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +16
-0
lines changed
ServiceStack.OrmLite.MySql/Converters
ServiceStack.OrmLite.Oracle/Converters
ServiceStack.OrmLite.PostgreSQL/Converters
ServiceStack.OrmLite.SqlServer/Converters
ServiceStack.OrmLite.Sqlite/Converters
ServiceStack.OrmLite/Converters Expand file tree Collapse file tree 6 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ namespace ServiceStack.OrmLite.MySql.Converters
6
6
public class MySqlStringConverter : StringConverter
7
7
{
8
8
public MySqlStringConverter ( ) : base ( 255 ) { }
9
+
10
+ //https://stackoverflow.com/a/37721151/85785
11
+ public override int MaxVarCharLength => UseUnicode ? 16383 : 21844 ;
9
12
10
13
public override string MaxColumnDefinition => "LONGTEXT" ;
11
14
}
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ protected OracleStringConverter(int stringLength) : base(stringLength)
14
14
15
15
public override string MaxColumnDefinition => UseUnicode ? "NVARCHAR2(2000)" : "NVARCHAR2(4000)" ;
16
16
17
+ public override int MaxVarCharLength => UseUnicode ? 2000 : 4000 ;
18
+
17
19
public override string GetColumnDefinition ( int ? stringLength )
18
20
{
19
21
if ( stringLength . GetValueOrDefault ( ) == StringLengthAttribute . MaxText )
@@ -36,6 +38,8 @@ public Oracle12StringConverter() : base(32767) {}
36
38
37
39
public override string MaxColumnDefinition => UseUnicode ? "NVARCHAR2(16383)" : "NVARCHAR2(32767)" ;
38
40
41
+ public override int MaxVarCharLength => UseUnicode ? 16383 : 32767 ;
42
+
39
43
public override string GetColumnDefinition ( int ? stringLength )
40
44
{
41
45
if ( stringLength . GetValueOrDefault ( ) == StringLengthAttribute . MaxText )
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ public class PostgreSqlStringConverter : StringConverter
9
9
{
10
10
public override string ColumnDefinition => "TEXT" ;
11
11
12
+ //https://dba.stackexchange.com/questions/189876/size-limit-of-character-varying-postgresql
13
+ public override int MaxVarCharLength => UseUnicode ? 10485760 / 2 : 10485760 ;
14
+
12
15
public override string GetColumnDefinition ( int ? stringLength )
13
16
{
14
17
//PostgreSQL doesn't support NVARCHAR when UseUnicode = true so just use TEXT
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ namespace ServiceStack.OrmLite.SqlServer.Converters
9
9
public class SqlServerStringConverter : StringConverter
10
10
{
11
11
public override string MaxColumnDefinition => UseUnicode ? "NVARCHAR(MAX)" : "VARCHAR(MAX)" ;
12
+
13
+ public override int MaxVarCharLength => UseUnicode ? 4000 : 8000 ;
12
14
13
15
public override string GetColumnDefinition ( int ? stringLength )
14
16
{
Original file line number Diff line number Diff line change @@ -5,5 +5,7 @@ namespace ServiceStack.OrmLite.Sqlite.Converters
5
5
public class SqliteStringConverter : StringConverter
6
6
{
7
7
public override string MaxColumnDefinition => UseUnicode ? "NVARCHAR(1000000)" : "VARCHAR(1000000)" ;
8
+
9
+ public override int MaxVarCharLength => 1000000 ;
8
10
}
9
11
}
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ public StringConverter(int stringLength)
17
17
18
18
public int StringLength { get ; set ; }
19
19
20
+ public virtual int MaxVarCharLength => UseUnicode ? 8000 : 4000 ;
21
+
20
22
protected string maxColumnDefinition ;
21
23
public virtual string MaxColumnDefinition
22
24
{
You can’t perform that action at this time.
0 commit comments