Open simonpcouch opened 8 months ago
@simonpcouch Hi, I have the same issue with an Oracle database. Should I open a new issue or can it be taken care of here? Thanks!
@ThomasSoeiro A separate issue is good! :)
Hmmm, I think I'd be inclined to include these in dbListTables()
, using our principle that if you can do SELECT foo
then dbExistsTable(con, "foo")
should be true, and "foo"
should be included in the output of dbListTables()
.
Synonyms are now supported with dbListTables()
and dbExistsTable()
.
My biggest concern at this point is performance, esp. in cases when databases have many synonyms. Should this feature be gated behind an argument?
Here are those benchmarks with the PR as-is (EDIT: updated timings below):
..where the values to the left of x = 1
are x = 0
(with a small shift for log(0)
). "Default" objects means what's available in a relatively fresh SQL Server Docker instance—length(dbListTables(con))
is 618. Timings for dbExistsTable()
are for a table that doesn't exist, so the synonyms_query
kicks in. Generally, doesn't look great.🏄
Will look into your most recent comments.
Updated benchmarks:
Definitely better than before but not negligible. I haven't seen enough real-world DBs to know how close to "worst-case" this is.
Let's table this PR until at least after the upcoming release. Will mark as draft for now.
Closes #221.
This PR modifies/adds SQL Server methods for
dbListTables()
,dbExistsTable()
, andodbcListObjects()
that include synonyms in output. This also means that synonyms will show up in the Connections pane.Note that this PR makes no changes todbListTables()
, which is noted in the original issue.[EDITs: update PR scope]