Comments (7)
I took a crack at querying MS Sql Server: https://github.com/themotleyfool/redash/tree/sql_server. I kept it pretty separate from the redshift query code, but I am still not sure if you want to merge it in. I can provide a PR if you are interested. It requires installing freetds and pymssql and a new DB_TYPE setting, but the code is pretty straight-forward. Unfortunately, there isn't an easy way to call Sql Server asynchronously 😦.
from redash.
It's great to see others find this project useful enough, to write code extending it :-)
I took a crack at querying MS Sql Server: https://github.com/themotleyfool/redash/tree/sql_server. I kept it pretty separate from the redshift query code, but I am still not sure if you want to merge it in. I can provide a PR if you are interested. It requires installing freetds and pymssql and a new DB_TYPE setting, but the code is pretty straight-forward.
My plan of adding support for additional databases was by just moving to using SQLAlchemy. But I'm not sure whether SQLAlchemy supports MSSql, and regardless I've realized that maybe it will be better to have the different databases as separate packages you install (i.e. redash_mssql
). This has the benefit that users who don't need a certain database plugin, don't need to install its dependencies.
So DB_TYPE will be the name of a module that redash will import. The different modules will just have to export the query_runner
function (or similar class if we make the logic more complicated).
What do you think?
Unfortunately, there isn't an easy way to call Sql Server asynchronously 😦.
Actually the only reason I changed the Redshift query runner to be async, was that psycopg2 ignored the INT signal otherwise. Although I do have plans for switching to async query runners (so we won't need to use threads to execute queries), it's currently postponed as I didn't find a good non-blocking IO library that will have support for most databases.
from redash.
plan of adding support for additional databases was by just moving to using SQLAlchemy
Well, if you want to move to SQLAlchemy, it does look like MS Sql Server is supported: http://docs.sqlalchemy.org/en/rel_0_9/dialects/mssql.html. I can also easily make a separate package. I can make my code work either way pretty easily, I think.
DB_TYPE will be the name of a module that redash will import
I was actually just thinking about adding a new model named Database (with fields: connection string, type) which is 1-to-many to Query. This would enable me to to query different databases (Postgres, Sql Server, MySql, etc) specifically for a particular query. I'm weary of over-complicating your project unnecessarily, though, if you don't think it's a valid use-case ;).
from redash.
I was actually just thinking about adding a new model named Database (with fields: connection string, type) which is 1-to-many to Query. This would enable me to to query different databases (Postgres, Sql Server, MySql, etc) specifically for a particular query. I'm weary of over-complicating your project unnecessarily, though, if you don't think it's a valid use-case ;).
Actually this is part of what this ticket is about :-) So if you want to take a stab at it, you're more than welcome!
Currently the models are using Django models, and I was thinking of rewriting them as SQLAlchemy models and making use of them in manager.py instead of directly querying the db. But you can implement this with Django models, and worst case we will rewrite this later.
from redash.
Sweet, I'll take a look. I'll probably stick with the Django models for now to make the PR a little more managable.
from redash.
@adamghill if you like, send me your email address (to arik at everything.me), so if I plan any major changes I will let you know.
from redash.
Resolved.
from redash.
Related Issues (20)
- Uncaught promise error in Edit Visualization Dialog Modal
- date parameter configuration in redash self hosting. HOT 3
- Redash does not connect to Microsoft SQL Azure HOT 2
- queury in queue issue
- SchedulerWorker doesn't refresh query HOT 1
- Redash can't refresh mongodb schema unless all collections are granted HOT 2
- How to customize data label in redash HOT 1
- Query Results Error When I Join Multitable
- How can I disable/hide filters in an embedded dashboard? HOT 1
- Problem with asset location server.css after setup on Ubuntu HOT 1
- Slack as Alert destination: URLs in messages posted to Slack are not clickable links HOT 1
- Downgrading then upgrading redash schemas doesn't work HOT 6
- DynamoDB Support (regression issue) HOT 2
- numberFormat and thousandsSep HOT 6
- How to add counter visualization clickable its is possible ? HOT 2
- Feature request: an installation script for Fedora! HOT 1
- Front end data type display exception HOT 7
- puppeteer issue with Apple Silicon chips HOT 19
- Data Source "Redshift (with IAM User/Role)" does not support Redshift Serverless HOT 2
- Redash adds `/redash` prefix if a string starts with `/api` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redash.