Re: [sqlite] How to query key-value-pairs similar to PostgreSQL HSTORE type?

2014-03-18 Thread mm.w
Hello, you might emulate it this way, depends on the scale, size matters 8) hstore id | key | value 1 | firstname | John 1 | lastname | Doe 2 | firstname | John 2 | lastname | Doe obj2hstore id_obj | id_hstore 2| 1 3| 2 Best. On Tue, Mar 18,

Re: [sqlite] How to query key-value-pairs similar to PostgreSQL HSTORE type?

2014-03-18 Thread Petite Abeille
On Mar 18, 2014, at 8:56 PM, Stefan Keller wrote: > And, actually, as you may have realized, PostgreSQL proved that even > (post-)relational databases can handle KVP efficiently. Just because one can, doesn't mean one should. But, as always, to each their own.

Re: [sqlite] How to query key-value-pairs similar to PostgreSQL HSTORE type?

2014-03-18 Thread Stefan Keller
Hi, Thank you all for the answers. Petite Abeille writ 2014-03-18 19:22 GMT+01:00 Petite Abeille : > If, for some reasons, you cannot even accomplish first normal form [1], i.e. > one and only one value per column, > well, then, maybe, a relational database is not the

Re: [sqlite] How to query key-value-pairs similar to PostgreSQL HSTORE type?

2014-03-18 Thread Petite Abeille
On Mar 18, 2014, at 2:46 AM, Stefan Keller wrote: > Any suggestions on how to query this most efficiently (like [select > value from "some_key"])? As mentioned, turn this construct into a regular relational table structure. If, for some reasons, you cannot even accomplish

Re: [sqlite] How to query key-value-pairs similar to PostgreSQL HSTORE type?

2014-03-18 Thread Hick Gunter
: Stefan Keller [mailto:sfkel...@gmail.com] Gesendet: Dienstag, 18. März 2014 02:47 An: General Discussion of SQLite Database; spatialite-us...@googlegroups.com Betreff: [sqlite] How to query key-value-pairs similar to PostgreSQL HSTORE type? Hi, I have a column which contains a string structure

Re: [sqlite] How to query key-value-pairs similar to PostgreSQL HSTORE type?

2014-03-17 Thread Tiago Rodrigues
If that is not an option, then you should probably create a function taking the HSTORE key and the sought key and returning the corresponding value or NULL. On Mon, Mar 17, 2014 at 11:41 PM, Tiago Rodrigues wrote: > Generally, I'd suggest you take these HSTORE

Re: [sqlite] How to query key-value-pairs similar to PostgreSQL HSTORE type?

2014-03-17 Thread Tiago Rodrigues
Generally, I'd suggest you take these HSTORE key-value-pairs types and recast them as a separate table (say, HSTORE (STORE integer primary key, KEY text, VALUE text) ) and then query (SELECT VALUE FROM {TABLE1} JOIN HSTORE ON HSTORE.STORE = {TABLE1}.{HSTORECOLUMN} WHERE VALUE = 'some_key';) On

[sqlite] How to query key-value-pairs similar to PostgreSQL HSTORE type?

2014-03-17 Thread Stefan Keller
Hi, I have a column which contains a string structure taken from the PostgreSQL HSTORE key-value-pairs type. This is an example of one column value: "operator"=>"police","name"=>"Zurich","some_key"=>"some_value" Any suggestions on how to query this most efficiently (like [select value from