66import pymysql
77from sqlalchemy import Engine , create_engine
88
9- from langgraph .checkpoint .mysql .aio import AIOMySQLSaver
10- from langgraph .checkpoint .mysql .asyncmy import AsyncMySaver
11- from langgraph .checkpoint .mysql . pymysql import PyMySQLSaver
9+ from langgraph .checkpoint .oceanbase .aio import AIOMySQLSaver
10+ from langgraph .checkpoint .oceanbase .asyncmy import AsyncMySaver
11+ from langgraph .checkpoint .oceanbase . pyoceanbase import PyOceanBaseSaver
1212
1313DEFAULT_MYSQL_URI = "mysql://mysql:mysql@localhost:5441/"
1414
@@ -23,19 +23,19 @@ def _checkpointer_pymysql():
2323 database = f"test_{ uuid4 ().hex [:16 ]} "
2424
2525 # create unique db
26- with pymysql .connect (** PyMySQLSaver .parse_conn_string (DEFAULT_MYSQL_URI ), autocommit = True ) as conn :
26+ with pymysql .connect (** PyOceanBaseSaver .parse_conn_string (DEFAULT_MYSQL_URI ), autocommit = True ) as conn :
2727 with conn .cursor () as cursor :
2828 cursor .execute (f"CREATE DATABASE { database } " )
2929 try :
3030 # yield checkpointer
31- with PyMySQLSaver .from_conn_string (
31+ with PyOceanBaseSaver .from_conn_string (
3232 DEFAULT_MYSQL_URI + database
3333 ) as checkpointer :
3434 checkpointer .setup ()
3535 yield checkpointer
3636 finally :
3737 # drop unique db
38- with pymysql .connect (** PyMySQLSaver .parse_conn_string (DEFAULT_MYSQL_URI ), autocommit = True ) as conn :
38+ with pymysql .connect (** PyOceanBaseSaver .parse_conn_string (DEFAULT_MYSQL_URI ), autocommit = True ) as conn :
3939 with conn .cursor () as cursor :
4040 cursor .execute (f"DROP DATABASE { database } " )
4141
@@ -45,17 +45,17 @@ def _checkpointer_pymysql_pool():
4545 database = f"test_{ uuid4 ().hex [:16 ]} "
4646
4747 # create unique db
48- with pymysql .connect (** PyMySQLSaver .parse_conn_string (DEFAULT_MYSQL_URI ), autocommit = True ) as conn :
48+ with pymysql .connect (** PyOceanBaseSaver .parse_conn_string (DEFAULT_MYSQL_URI ), autocommit = True ) as conn :
4949 with conn .cursor () as cursor :
5050 cursor .execute (f"CREATE DATABASE { database } " )
5151 try :
5252 pool = get_pymysql_sqlalchemy_engine (DEFAULT_MYSQL_URI + database )
53- checkpointer = PyMySQLSaver (pool .raw_connection )
53+ checkpointer = PyOceanBaseSaver (pool .raw_connection )
5454 checkpointer .setup ()
5555 yield checkpointer
5656 finally :
5757 # drop unique db
58- with pymysql .connect (** PyMySQLSaver .parse_conn_string (DEFAULT_MYSQL_URI ), autocommit = True ) as conn :
58+ with pymysql .connect (** PyOceanBaseSaver .parse_conn_string (DEFAULT_MYSQL_URI ), autocommit = True ) as conn :
5959 with conn .cursor () as cursor :
6060 cursor .execute (f"DROP DATABASE { database } " )
6161
0 commit comments