Comments (7)
Here's the initialization:
class SetListDb extends Dexie {
public metaNames: Dexie.Table<MetaNames, number>;
public tunes: Dexie.Table<Tune, number>;
public lists: Dexie.Table<List, number>;
public tunesInLists: Dexie.Table<TuneInList, [number, number, number]>;
constructor(name: string, options?: any) {
super(name, options);
this.version(2).stores({
tunes: '@id, name, abc, leader, roadMap, countOff, key, bpm',
lists: '@id, name',
tunesInLists: '[tuneId+listId+order],tuneId,listId,order',
metaNames: '@id, tabTitle'
});
this.metaNames = this.table('metaNames');
this.tunes = this.table('tunes');
this.lists = this.table('lists');
this.tunesInLists = this.table('tunesInLists');
}
}
And the model:
export class MetaNames {
tabTitle: string;
constructor(name:string) {}
}
export class Tune {
id:number;
name: string;
abc: string;
leader: string;
roadMap: string;
countOff: string;
key: string;
tempo: string;
lists: List[];
order?: number;
constructor(name:string) {this.name = name}
}
export class List {
id:number;
name: string;
tunes:Tune[];
constructor(name:string) {this.name=name}
}
export class TuneInList {
id?: number;
tuneId: number;
listId: number;
order: number;
constructor() {}
}
from dexie.js.
Yes! can confirm - it works. And I ran npx dexie-cloud@latest export all-data.json
and all the data is there.
from dexie.js.
One thing that would give me a little clue is if I could see what is stored on the cloud for my account. Is there a way to dump that out? Or is the a "Dashboard" website I could log into? If the problem were data-related I can try to remove that record and see if the rest works.
I'll try to delete my indexedDB and put records in one at a time and see if I get a pattern. I don't have time today for that, though.
from dexie.js.
Thanks for the log printouts - seems as the problem is related a table with compound primary keys but the keys are not arrays as expected but plain strings. This could indicate a bug in dexie-cloud. I'll see if I can reproduce the issue from your database if I get a chance tomorrow. You can export everything to a JSON file if that would help using npx dexie-cloud@latest export. Compound primary keys are stored as JSON strings and it might be a problem with that. I might get wiser after looking into your db.
An admin dashboard with database and subscription management is under development as the last part before the service goes into production in the end of the summer. For now, it's only npx dexie-cloud export
and the REST API available to inspect what's stored in the cloud.
from dexie.js.
That is what export gives me - but did you want the contents of indexedDB instead? That is much larger.
from dexie.js.
A little more info:
I split the writes into sections and I successfully wrote all the MetaNames, Tunes, and Lists. That synced up properly.
But when I went to write TuneInList it started failing. That is doing a many-to-many relationship.
from dexie.js.
I found the issue and it's really a bug occurring when client is about to sync a table with inbound compound keys. I've released a new version with "test" tag for you to try out:
npm i [email protected]
Let me know if this fixes it.
Another thing I noticed is that the typings for IDs in your code are all numbers while they really should be strings ('@'-keys) and the relation table should be:
export class TuneInList {
//id?: number; not there!
tuneId: string; // not number
listId: string; // not number
order: number;
constructor() {}
}
Please try out the fix and let me know if everything is working properly with it.
from dexie.js.
Related Issues (20)
- Seeking Guidance for Serverless Bi-directional Sync Between Two Dexie.js Instances HOT 7
- Dexie Cloud Feature request: user-specific public realm
- Is it possible to invite a user who is not signed up? HOT 6
- Error: too much recursion HOT 1
- Typescript returns errors regarding ID that is undefined HOT 11
- bulkDelete() for large number of primary keys is way too slow
- WebPush for DexieCloud Feature Request
- Dexie Cloud feature request: in-app invitations HOT 1
- dexie cloud db entries with image blob disapear HOT 2
- Return only one field?
- Typescript complain with compound ID HOT 2
- related tables in dexie HOT 2
- Dexie Cloud Manager - "Manage users" error HOT 3
- Authentication error with the fresh.deno framework HOT 1
- Issue with Dexie's table.where() Method when Targeting Existing IndexedDB with Indexed KeyPath
- "default" is not exported by "../../../Dexie.js/dist/dexie.min.js", imported by "../../../Dexie.js/import-wrapper-prod.mjs". HOT 14
- Transaction context is lost when running a recursive call in a loop HOT 8
- Backwards compatibility issue - ReferenceError: queueMicrotask is not defined HOT 2
- circularly reference on update HOT 10
- dexie-cloud feature request: Transaction support on REST API HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dexie.js.