safety-analytics-mapping / pysqldb3

Python3 version of pysqldb portion of ris library
1 stars 1 forks source link

sql_to_pg_qry() function in data_io doesn't allow cross-database joins #49

Closed cindyatnycdot closed 8 months ago

cindyatnycdot commented 1 year ago

The sql_to_pg_qry() function allows only one MS SQL database to be queried (since you can only input one Microsoft SQL Server database connection in the function), so if I wanted to write a query that joins data across MS databases on the same server (for example, between the STREETASSESSMENT and LionRB2 databases), it cannot generate a joined output table that is uploaded to PG.

cindyatnycdot commented 8 months ago

I looked into this issue, and I realize that you can write the query with a different database in the server and it will work. What won't work is if you add -- style comments into the query, and then it can't read it properly.