Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Active Record 有一个调用方法connected?,如果 Active Record 连接则返回 true。DataMapper 是否有等价物?我在 API 文档中找不到任何内容。如果没有,检查这个的最合适的解决方案是什么?
connected?
DataMapper 是多适配器 ORM 并期望每个适配器保持与其数据库的连接。有些适配器甚至没有连接,比如 yaml 或内存。因此,通常,您无法知道 DataMapper 是否已连接。