New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
configuring read only connection still uses default connection #453
Comments
@chrisclark I think this might need your input as I suspect this is something you'd decided on. |
@marksweb @pablobuenaposada you are correct the connection is stored with the query. Maybe this was the start of being able to support queries to multiple backend connections? |
@pablobuenaposada Do you know the file/folder name to update the settings? I am also facing the same issue. |
@RahulSwami01 it's actually in the explorer_query table- look at the connection column |
Getting following error InvalidExplorerConnectionException at /explorer/1/Attempted to access connection other, but that is not a registered Explorer connection.
|
@RahulSwami01 Did you also change EXPLORER_DEFAULT_CONNECTION in settings.py? |
DATABASES = {
|
Yeah I think you should find this setting (which is probably set to default and change it to other) |
I have the following connection strings: and i am trying to connect to the new database "other" mentioned above. EXPLORER_CONNECTIONS = { 'Default': 'default'} |
I made it, it shows me loading......loading...... and not showing anything. EXPLORER_CONNECTIONS = { 'Default': 'default', |
The following query I am using to test it: When I am running in Microsoft SQL server management studio, it gives me the output. |
Ok and you updated all the queries in the explorer_query table, connection column to point to 'other'? if this still doesn't work let me know and I'll test a similar setup this evening after work |
Oh - looks like you are using mysql django backend ('django.db.backends.mysql') but connecting to a microsoft sql server instance? |
do you think that is the issue? |
I haven't ever used Django with MS SQL but yeah it requires a 3rd party lib to be installed and configured https://docs.djangoproject.com/en/4.1/ref/databases/#third-party-notes |
Thank you very much for the link. Unfortunately, it's not working for me. I have an Idea, Let me know if it is possible. I have a code that works on the package pyodbc(for MS SQL) let's say "fileA.py". Can we integrate this code with SQL explorer? user needs to pass the query from the front hand to fileA.py. the query will run using the code "FileA.py" results have been saved in a python data frame, and that data frame result has been sent back to the front-hand user. |
@RahulSwami01 I think your best bet is to figure out how to get your Django app connected up to MS SQL server if that's the db you need to use. Then everything else will just work. |
It’s been 4 days, I found out that it only works with the old version
(Django). For sql explorer we need new version (Django). So it’s deadlock
for me.
…On Fri, Feb 17, 2023 at 8:43 AM Richard Lawson ***@***.***> wrote:
@RahulSwami01 <https://github.com/RahulSwami01> I think your best bet is
to figure out how to get your Django app connected up to MS SQL server if
that's the db you need to use. Then everything else will just work.
—
Reply to this email directly, view it on GitHub
<#453 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB4UOWZKL73CHHZAPZL34DTWX56AHANCNFSM5BREXZHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@RahulSwami01 What version do you need to use? Looking at the tox seyup - looks like sql explorer is tested on 3.2 and above. It may work on earlier versions (@marksweb ?) |
Yeah version 3 dropped support for <3.2 of django. |
Hi, I am using sql-explorer in a project, at first decided to use the default django connection and everything worked as expected, later on I decided to create a new database user with read only permissions for sql-explorer as your documentation suggests.
Unfortunately, after this change each of the queries I had in there was throwing me a 500 error, in detail, it was throwing:
After getting really mad and check the code I found what was the problem, the connection used for every query is somehow stored in the Query django model you guys have (which I don't know why) which of course it was still pointing to the default connection and not the new one, had to manually update all the
connection
fields of this Query model to point to the new connection like this:after this everything is working fine again with the new connection, not sure why you guys want to store the connection but I think we are missing a mechanism to update those if you change EXPLORER_CONNECTIONS in settings.py at least.
The text was updated successfully, but these errors were encountered: