On 6/9/2018 8:31 PM, Simon Slavin wrote: > On 10 Jun 2018, at 2:18am, Andy Goth <andrew.m.g...@gmail.com> wrote: >> Skip computed columns in the value list? If two tables have the same >> schema, this should duplicate one into the other, but apparently not: >> >> INSERT INTO table2 SELECT * from table1; > > This syntax, when found with a computed column, would be something > that the SQLite engine would have to notice and act correctly. The > same in the case of CREATE TABLE ... SELECT ... . > > There are a number of other niggles. For instance, creating and > updating an index which includes a VIRTUAL calculated column could be > complicated and time-consuming. It may be that for a computed column > to appear in an index it must be STORED. On the other hand, the way > SQLite works internally might make that unnecessary.
I think it's clear why SQLite doesn't already have this feature. The required underlying capability is already available. The remaining bits are a convenience to the end user at the cost of significant added complexity inside the engine. This is probably not going to be added until SQLite's primary developers themselves decide they need it, or until someone else decides it's important enough to them to contribute code and/or funding. SQLite doesn't seek to implement all things SQL, just the parts that have proven to be a workhorse. There's been a gradual shift as more development hours have been invested, but the "Lite" still means something. https://sqlite.org/omitted.html I've watched this list get shorter over the years, but the items that remain are increasingly likely to become permanent fixtures. And hey, that list was a welcome reminder that views can have triggers which can translate back to real DELETE, INSERT, and UPDATE operations on the underlying table. This might be what you want. SQLite's embeddability and ease of integration (particularly with Tcl) makes it very easy to wrap, so you can give yourself commands that generate and access tables using whatever syntax works best for you. You can write code that intercepts and translates the computed column syntax of your choice to automatically generated fancy views with triggers. Once you get the semantics nailed down and others find your work useful, that effort can serve as a reference implementation for actually adding the capability to SQLite itself. -- Andy Goth | <andrew.m.goth/at/gmail/dot/com>
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