Re: [sqlite] To JSON or not to JSON

2018-07-08 Thread Clemens Ladisch
Cecil Westerhof wrote:
> my SQLite database contains for example:
>
> "5BF19111-9FD5-48CA-B919-A09411346A87""[
>   ""The journey of a thousand miles
> must begin with a single step.
>
> - Lao Tzu"",
>   ""Welke stap kun je vandaag zetten,
> om dat verre doel te bereiken?""
> ]""2018-07-07"
>
> Respectively quoteID, quote (with extra line(s)) and lastUsed.
>
> Is this an acceptable way to implement it, or would it be better to unravel
> the elements in different records?

Putting the quotes into a separate table, one per row, would allow you to
access them individually.

If you never need to access individual quotes, and if you know that this
will never happen in the future, you could just as well keep storing the
quotes as an array.  (And then please tell us how you manage to predict
the future.  ;-)


Regards,
Clemens
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] To JSON or not to JSON

2018-07-08 Thread Cecil Westerhof
A long time ago I changed a line base application to a SQLite application.
Every line was a record and this record could have several elements. Every
element was send to Twitter with a minute between them. When converting I
kept it like this. So my SQLite database contains for example:
"5BF19111-9FD5-48CA-B919-A09411346A87""[
  ""The journey of a thousand miles
must begin with a single step.

- Lao Tzu"",
  ""Welke stap kun je vandaag zetten,
om dat verre doel te bereiken?""
]""2018-07-07"

Respectively quoteID, quote (with extra line(s)) and lastUsed.

Is this an acceptable way to implement it, or would it be better to unravel
the elements in different records?

-- 
Cecil Westerhof
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users