Zepo / GYDataCenter

An alternative to Core Data for people who like using SQLite directly.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

请问如何增加unique约束?

ccnyou opened this issue · comments

commented

目前不支持。由于框架的接口设计以简单为主,没有返回 error,只要 sql 拼写没有错误,且接口使用正确,都能保持存取 db 成功。如果支持 unique 约束,则不得不加 error 参数,上层使用也得处理 error 情况,增加开发者负担。所以目前 unique 只能在业务逻辑层保证。

那么复合主键呢?

commented

复合主键将在后续版本支持

请问当前版本怎么表达一张关系表呢?

commented

直接建关系表,业务逻辑层保证 unique 约束