#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2023/6/22 21:55 # @Author : old tom # @File : main.py # @Project : futool-db-lite # @Desc : 数据库测试 from session.engine.dbengine import DatabaseEngine from session.engine.dbengine import container if __name__ == '__main__': db_engine = DatabaseEngine('testdb') db_engine2 = DatabaseEngine('testdb') print(db_engine.engine is db_engine2.engine) session_factory = db_engine.create_session_factory() session_factory2 = db_engine2.create_session_factory() print(session_factory is session_factory2) # for i in range(100): # # sess = session_factory.create_session() # sess = session_factory.open_session() # print(id(sess)) print(container.engines, container.factory)