Default behavior for attached bases

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Default behavior for attached bases

raanan barzel-2
The documentation says :Tables in an attached database can be referred
to using the syntax schema-name.table-name. If the name of the table is
unique across all attached databases and the main and temp databases,
then the schema-name prefix is not required. If two or more tables in
different databases have the same name and the schema-name prefix is not
used on a table reference, then the table chosen is the one in the
database that was least recently attached.

I would like to suggest a different default behavior (potentially as an
option): "when the schema-name prefix is not used, then *all* the tables
are accessed, potentially with a qualifier for distinctiveness."

This allows to write a simpler application code, independent of the
actual collection of bases involved.



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Default behavior for attached bases

Simon Slavin-3
On 27 Mar 2019, at 6:46am, raanan barzel <[hidden email]> wrote:

> I would like to suggest a different default behavior (potentially as an option): "when the schema-name prefix is not used, then *all* the tables are accessed, potentially with a qualifier for distinctiveness."

This would break numerous existing applications which depend on current behaviour.  It would also slow down almost every API call since for every mention of a table the call would have to check every attached database for a table with the specified name.  This would slow down most API calls.

This change is unlikely to happen.  If it did happen it would require a PRAGMA to switch between old and new behaviours.  Would you like to make an argument to show why your proposal is worth implementing ?

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: [EXTERNAL] Default behavior for attached bases

Hick Gunter
In reply to this post by raanan barzel-2
"The same name" does not imply "the same structure"

-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:[hidden email]] Im Auftrag von raanan barzel
Gesendet: Mittwoch, 27. März 2019 07:47
An: [hidden email]
Betreff: [EXTERNAL] [sqlite] Default behavior for attached bases

The documentation says :Tables in an attached database can be referred to using the syntax schema-name.table-name. If the name of the table is unique across all attached databases and the main and temp databases, then the schema-name prefix is not required. If two or more tables in different databases have the same name and the schema-name prefix is not used on a table reference, then the table chosen is the one in the database that was least recently attached.

I would like to suggest a different default behavior (potentially as an
option): "when the schema-name prefix is not used, then *all* the tables are accessed, potentially with a qualifier for distinctiveness."

This allows to write a simpler application code, independent of the actual collection of bases involved.



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users