From 8204688621e92708cda5d36f5c6ca0195e4348f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=B5=E6=97=AD?= Date: Mon, 21 Feb 2022 23:08:52 +0800 Subject: [PATCH 1/2] fix: change column `value` to Text type --- sql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql.py b/sql.py index f20e2b2..720a5f0 100644 --- a/sql.py +++ b/sql.py @@ -113,7 +113,7 @@ def open(self, namespace: str) -> StorageBase: # Create a table with the given namespace table = Table(namespace, self._metadata, Column('key', String(767), primary_key=True), - Column('value', String(32768)), + Column('value', Text(32768)), extend_existing=True) class NewKV(KV): From a4c5e9ed81b7c8b3e96f660f84a85e04f2821aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=B5=E6=97=AD?= Date: Mon, 21 Feb 2022 23:12:40 +0800 Subject: [PATCH 2/2] fix: import Text type https://docs.sqlalchemy.org/en/14/core/type_basics.html#sqlalchemy.types.Text --- sql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql.py b/sql.py index 720a5f0..6575391 100644 --- a/sql.py +++ b/sql.py @@ -5,7 +5,7 @@ from jsonpickle import encode, decode from typing import Any from sqlalchemy import ( - Table, MetaData, Column, Integer, String, + Table, MetaData, Column, Integer, String, Text, ForeignKey, create_engine, select) from sqlalchemy.orm import mapper, sessionmaker from sqlalchemy.orm.exc import NoResultFound