Skip to content

Commit 28d8ed4

Browse files
committed
try to fix mysql regression for TermType text definition viz-a-viz uniqueness indexes
1 parent 0adb131 commit 28d8ed4

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

rdflib_sqlalchemy/tables.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ def create_asserted_statements_table(interned_id, metadata):
4949
"termComb",
5050
),
5151
UniqueConstraint(
52-
"subject", "predicate", "object", "context", name="{interned_id}_asserted_spoc_key",
52+
"subject",
53+
"predicate",
54+
"object",
55+
"context",
56+
name="{interned_id}_asserted_spoc_key",
5357
),
5458
)
5559

@@ -83,7 +87,10 @@ def create_type_statements_table(interned_id, metadata):
8387
"termComb",
8488
),
8589
UniqueConstraint(
86-
"member", "klass", "context", name="{interned_id}_type_mkc_key",
90+
"member",
91+
"klass",
92+
"context",
93+
name="{interned_id}_type_mkc_key",
8794
),
8895
)
8996

@@ -120,7 +127,11 @@ def create_literal_statements_table(interned_id, metadata):
120127
"termComb",
121128
),
122129
UniqueConstraint(
123-
"subject", "predicate", "object", "context", name="{interned_id}_literal_spoc_key",
130+
"subject",
131+
"predicate",
132+
"object",
133+
"context",
134+
name="{interned_id}_literal_spoc_key",
124135
),
125136
)
126137

@@ -162,7 +173,11 @@ def create_quoted_statements_table(interned_id, metadata):
162173
"termComb",
163174
),
164175
UniqueConstraint(
165-
"subject", "predicate", "object", "context", name="{interned_id}_quoted_spoc_key",
176+
"subject",
177+
"predicate",
178+
"object",
179+
"context",
180+
name="{interned_id}_quoted_spoc_key",
166181
),
167182
)
168183

rdflib_sqlalchemy/types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
from rdflib.graph import Graph, QuotedGraph
22
from rdflib.term import Node
33
from six import text_type
4+
from sqlalchemy.dialects import mysql
45
from sqlalchemy import types
56

67

78
class TermType(types.TypeDecorator):
89
"""Term typology."""
910

10-
impl = types.Text
11+
impl = types.Text().with_variant(mysql.TEXT(255), "mysql")
1112

1213
def process_bind_param(self, value, dialect):
1314
"""Process bound parameters."""

0 commit comments

Comments
 (0)