On 29 Jun 2017, at 19:06, Jens Alfke wrote:

>> On Jun 29, 2017, at 12:13 AM, Hick Gunter <h...@scigames.at> wrote:
>>
>> Double quotes is specifically for building identifiers that "look strange" 
>> (i.e. embedded spaces, keywords, ...) which IMHO should be avoided because 
>> it tends to clutter up the statement.
>
> I agree that if you’re generating the schema by hand you should avoid 
> creating names that require quoting.
>
> However, if tables/columns/indexes are being generated dynamically, it can be 
> very convenient to name them based on the external item that uses them, and 
> that name might involve “strange” characters.

Yes, I wrote a big function that strips all non-conforming chars, words etc. 
from column names (since we use '...' and I got some errors) because we import 
CSV user data into a table where the columns are the CSV columns.

I might x-check to see if I can switch to "..." and avoid all the hassle at all.


> In my case, I create indexes on the fly based on JSON paths like 
> “address[0].zipcode”, so I use the path as part of the index name. This is 
> simpler than escaping the punctuation, using a digest of the path, or making 
> up an identifier that then has to be stored somewhere else.

Good point. We need to do the same in the future.

> It also makes the schema a lot easier to understand when looking at generated 
> statements or poking around in the sqlite3 tool.

True too.

-- 

Robert M. Münch, CEO
M: +41 79 65 11 49 6

Saphirion AG
smarter | better | faster

http://www.saphirion.com
http://www.nlpp.ch

Attachment: signature.asc
Description: OpenPGP digital signature

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

Reply via email to