vasern / vasern

Vasern is a fast, lightweight and open source data storage for React Native

Home Page:https://vasern.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No error shown though i give the false value

apppro123 opened this issue · comments

For example if i decalre Id: "int" in the schema and insert for example Id. "hello" there is no error like "property Id should be an int and not an string!".
And somehow i event can store an "normal" object under a refrence without the true props of this refrence. I just found out that i can save anything (any value (boolean, int...)) under anything (any value...). Dont know if this is a bug or just my mistake, if i have something wrong in my code. i could post it if you want.

At the moment, the storage engine stores records as key-value pairs. An object before save to the database will be “stringify” which basically combines all values and separate by commas.

In some case, storing value with different types might cause parse error. Some other cases it might works. Though it is not recommended. I’m working to complete this feature (ensure inputs are valid)

No problem. It is just much easier for me if i can insert objects in an object. Because for some things i dont need an id but i have multiple props and want to summarise them.
For example in an calendar event the alarm. I want to have it simple and not have to set up an own db for alarms and then insert it in the calendar event db.
Maybe im wrong with it and it is much easier this way (im dont program for a loooong way).
Thank you for any help on it!

I see. I think the new storage engine will help you alot in this case. It will be a NoSQL database.

I recently published an article about Vasern new data format if you are keen to know. Link The pros and cons of different data formats: key-values vs tuples

So is it right if i make a db now and insert data there and then i want to add some extra props to this db, i have to insert the whole data again? Are there also other problems?
Or is this data still in the "changed" db and the new data just has the new props?
(And thank you for this article, was very helpful!)

Yes, @apppro123. Currently, Vasern features are limited to creating the database schema, create-update-read-delete records that match with the schema. (So anything other than that can cause issue).

I am confusing this part Or is this data still in the "changed" db and the new data just has the new props?. Can you explain a little more? Thanks!

I'm asking myself if the old data still persist and i can input the new data and can read the old data normally. Just with the difference that the old data has the new props (that i have added to the db schema) doesn't have.
Is this right?

Yes, that is right. You can add more props to the current schema and reload the application. Records load will reflex with the new schema!

Ok, perfect, than i can use this for my app!
(Question not just related to this module: Do i have to add the names of the modules i used in my app in the description of the app if i release it?)
Thank you for your responses!!!!!!

It is recommended to add the new properties to the end of the old schema. For example:

var TodoSchemas = {
   name: "Todos",
   props: {
      name: 'string',
      status: 'boolean',
      description: '?string' // new prop
      // another new prop
   }
}

Makes sense!

Do i have to add the names of the modules. I assume you mean about the licenses.

You won't need to mention Vasern copyright. At the moment, it is under Apache License (and it meant to be open source in the future too). You can have a look at the ./licenses for more details. :)

Thank you a lot!

You're welcome.

I really appreciate your questions. It helps me complete what missing for the database

@apppro123 I'm really interested in trying out apps. In case you publish your app and want to share, I'd love to try!

I will write when the app is ready for the public! 👍

I will close this issue since it has been resolved. Also, feel free to reopen or create a new one again