indexeddb - How to define and use database relationships in dexie js?
问题描述
Is it possible to create a relationship in indexDB
using Dexie js
If possible how to define and use them ?
i have tried looking through the Dexie js
documentation they haven't mentioned database relationship anywhere
解决方案
Yes, there is package dexie-relationships. I've tried it but finally remove. Cuz:
indexedDb
does not have real relationships like I used to in MySQL. This library is just sugar overdexie
.- I faced problem with drop table, cuz reltionships library does not accepts
null
in table definition (tries tonull.split()
it). - Instead of that library I use simple repositories (classes or functions) to fetch all required data with short syntax. And so you don't need relationships library cuz all relations are hidden in repositories and you don't need to use relations directly.
Dexie
v3.0 is now inbeta.1
stage and I don't know whether compatible withdexie-relationships
or would ever.
PS: too late, but I think it should be published. It would save me a lot of time if I read this few month before.
推荐阅读
- android - 我们可以在生产环境中使用 runblocking 和协程来进行房间查询吗?
- hive - sqoop mysql 主键为空
- amazon-web-services - 如何使用 Databricks 访问 AWS 公共数据集?
- ios - 需要在查看当前 iOS swift 时显示加载屏幕?
- java - 依赖的位置在哪里?
- regex - 捕获指定的正则表达式,除了特定的结束字符串
- azure - 我们如何保护 API 以仅服务于白名单的客户端?Azure 函数和 Web API 之间的通信
- scala - 平面图中的 Scala 尾递归
- slider - cypress 中的滑块调用更改,但更改未在文本框中捕获
- excel - 如何搜索单元格与列单元格之间的相似性,并获得最相似的一个?(优秀)