Created
March 23, 2015 16:39
-
-
Save dsuch/9a18aa95da3e711175dd to your computer and use it in GitHub Desktop.
SQL Server + Zato
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have solved the problem by modifying these lines in zato. I do not know if this has been the best method , but it has worked to give ZATO connectivity with SqlServer. | |
First of all , I installed and configured FreeTDS and unixODBC (http://blog.tryolabs.com/2012/06/25/connecting-sql-server-database-python-under-ubuntu/) | |
Then: | |
In /opt/zato/2.0.0/local/zato-common/src/zato/common/init.py, | |
add 'mssql+pyodbc': 'SELECT 1', | |
to var: ping_queries | |
In /opt/zato/2.0.0/zato-web-admin/src/zato/admin/zato_settings.py, | |
add 'mssql+pyodbc': 'MS SQL Server', | |
to var: engine_friendly_name | |
add 'mssql+pyodbc': 'MS SQL Server', | |
to var: engine_friendly_name | |
add 'mssql':'mssql+pyodbc', | |
to var: django_sqlalchemy_engine | |
So I had to correct errors in web_admin interface because zato not expect a null db_name: | |
In /opt/zato/2.0.0/zato-server/src/zato/server/service/internal/outgoing/sql.py | |
modify: | |
output_required = ('id', 'name', 'is_active', 'cluster_id', 'engine', 'host', Integer('port'), 'username', Integer('pool_size')) | |
output_optional = ('db_name', 'extra',) | |
In /opt/zato/2.0.0/local/zato-web-admin/src/zato/admin/static/js/outgoing/sql.js | |
modify this line in ready function: | |
$.fn.zato.data_table.setup_forms(['name', 'username', 'engine', 'host', 'port', 'pool_size']); | |
And finally: | |
In /opt/zato/2.0.0/zato-web-admin/src/zato/admin/web/forms/outgoing/sql.py | |
Modify in CreateForm Class: | |
db_name = forms.CharField(required=False, widget=forms.TextInput()) | |
And add in Editform Class: | |
db_name = forms.CharField(required=False, widget=forms.TextInput()) | |
Thanks for all !! | |
Cheers.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To avoid the error message :
I did this modification In file
in import section add :
in function SQLConnectionPool change :
self.engine = create_engine(engine_url, **_extra)
with :