feat: Introduce new database schema for DatabaseSessionService

Part 1 of https://github.com/google/adk-python/discussions/3605.

This change adds a new schema that uses JSON serialization to store Events data in the database. A new "adk_internal_metadata" table is also added to store information like schema version. Since we want to keep supporting existing DB, we fork from the original schema and call it "v0", while the new one is called "v1".

The change is no-op for existing users. In later change, the new schema will be used for new databases, and migration scripts will be provided for existing databases.

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 844986248
This commit is contained in:
Liang Wu
2025-12-15 17:32:48 -08:00
committed by Copybara-Service
parent a0885064b0
commit 7e6ef71eec
6 changed files with 730 additions and 406 deletions
@@ -17,7 +17,7 @@ from __future__ import annotations
import pickle
from unittest import mock
from google.adk.sessions.database_session_service import DynamicPickleType
from google.adk.sessions.schemas.v0 import DynamicPickleType
import pytest
from sqlalchemy import create_engine
from sqlalchemy.dialects import mysql