Re: [sqlalchemy] Syntax error from sqlalchemy generated sql to sybase ase

2018-11-28 Thread Ken MacKenzie
That makes sense, and as much as I would volunteer to try to maintain the 
dialect, I can't see justify using work resources (where I have access to 
Sybase) to maintain an open source component for a DB we are working to 
migrate away from.

Since the metadata is collecting ok, minus some type catches I have to do 
to write to other DB's, I can maybe just write raw SQL through sql alchemy 
or worst case through pyodbc to deal with collecting the records.

Thank you for the help.

Ken

On Wednesday, November 28, 2018 at 6:12:41 PM UTC-5, Mike Bayer wrote:
>
> Hi there - 
>
> Unfortuantely, the Sybase dialect is unmaintained and will likely be 
> removed from a future SQLAlchemy release.For this database to be 
> usable, a dedicated maintainer would need to volunteer and we can set 
> them up with a new sybase ASE dialect available as a third party 
> download.   The demand for this database is extremely low, the Python 
> drivers are poorly maintained and the database itself is extremely 
> difficult to run for testing purposes. 
>
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Syntax error from sqlalchemy generated sql to sybase ase

2018-11-28 Thread Mike Bayer
Hi there -

Unfortuantely, the Sybase dialect is unmaintained and will likely be
removed from a future SQLAlchemy release.For this database to be
usable, a dedicated maintainer would need to volunteer and we can set
them up with a new sybase ASE dialect available as a third party
download.   The demand for this database is extremely low, the Python
drivers are poorly maintained and the database itself is extremely
difficult to run for testing purposes.





On Wed, Nov 28, 2018 at 4:43 PM Ken MacKenzie  wrote:
>
> Error message:
>
> sqlalchemy.exc.ProgrammingError: (pyodbc.ProgrammingError) ('42000', "[42000] 
> [FreeTDS][SQL Server]Incorrect syntax near 'dbo.APPLICATION_STATUS_DIM.'.\n 
> (102) (SQLExecDirectW)") [SQL: 'SELECT 
> dbo."APPLICATION_STATUS_DIM"."APPLICATION_STATUS_SKEY" AS 
> "dbo_APPLICATION_STATUS_DIM_APPLICATION_STATUS_SKEY", 
> dbo."APPLICATION_STATUS_DIM"."APPLICATION_STATUS_CD" AS 
> "dbo_APPLICATION_STATUS_DIM_APPLICATION_STATUS_CD", 
> dbo."APPLICATION_STATUS_DIM"."APPLICATION_STATUS_DESC" AS 
> "dbo_APPLICATION_STATUS_DIM_APPLICATION_STATUS_DESC" \nFROM 
> dbo."APPLICATION_STATUS_DIM"'] (Background on this error at: 
> http://sqlalche.me/e/f405)
>
> Code triggering the error:
>
> for record in source.query(table).all():
>
> pip freeze output:
>
> pkg-resources==0.0.0
> psycopg2==2.7.6.1
> pyodbc==4.0.24
> SQLAlchemy==1.2.14
>
> Purpose of the code:
>
> Trying a quick stab at migrating a db from sybase ase to either postgres or 
> sql server. Evaluating both targets. Connection works fine, pulling table 
> metadata works fine, writing to target db structure from meta works fine, but 
> selecting the records leads to that.
>
> If I take that statement as is and paste into dbeaver (replacing the \n with 
> an actual carriage return) everything works.
>
> This fails on both linux (using FreeTDS version set to 5) and windows (using 
> the dsn name for the actual ASE driver setup in my odbc)
>
> I am confused what is going on here that causes sybase to see this as a 
> syntax error.
>
> Ken
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> ---
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


[sqlalchemy] Syntax error from sqlalchemy generated sql to sybase ase

2018-11-28 Thread Ken MacKenzie
Error message:

sqlalchemy.exc.ProgrammingError: (pyodbc.ProgrammingError) ('42000', 
"[42000] [FreeTDS][SQL Server]Incorrect syntax near 
'dbo.APPLICATION_STATUS_DIM.'.\n (102) (SQLExecDirectW)") [SQL: 'SELECT 
dbo."APPLICATION_STATUS_DIM"."APPLICATION_STATUS_SKEY" AS 
"dbo_APPLICATION_STATUS_DIM_APPLICATION_STATUS_SKEY", 
dbo."APPLICATION_STATUS_DIM"."APPLICATION_STATUS_CD" AS 
"dbo_APPLICATION_STATUS_DIM_APPLICATION_STATUS_CD", 
dbo."APPLICATION_STATUS_DIM"."APPLICATION_STATUS_DESC" AS 
"dbo_APPLICATION_STATUS_DIM_APPLICATION_STATUS_DESC" \nFROM 
dbo."APPLICATION_STATUS_DIM"'] (Background on this error at: 
http://sqlalche.me/e/f405)

Code triggering the error:

for record in source.query(table).all():

pip freeze output:

pkg-resources==0.0.0
psycopg2==2.7.6.1
pyodbc==4.0.24
SQLAlchemy==1.2.14

Purpose of the code:

Trying a quick stab at migrating a db from sybase ase to either postgres or 
sql server. Evaluating both targets. Connection works fine, pulling table 
metadata works fine, writing to target db structure from meta works fine, 
but selecting the records leads to that.

If I take that statement as is and paste into dbeaver (replacing the \n 
with an actual carriage return) everything works.

This fails on both linux (using FreeTDS version set to 5) and windows 
(using the dsn name for the actual ASE driver setup in my odbc)

I am confused what is going on here that causes sybase to see this as a 
syntax error.

Ken

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] JSON Support for mssql 2016

2018-11-28 Thread Mike Bayer
OK, take a look at that SQLite commit, where someone else added the
exact same thing for SQLite:

https://github.com/sqlalchemy/sqlalchemy/commit/62d59088dfe86d7ecabd85ad626ee108b668acc5

the feature for SQL server would look similar, although I've taken a
look at 
https://docs.microsoft.com/en-us/sql/relational-databases/json/json-data-sql-server?view=sql-server-2017
and it looks like they don't have a JSON datatype explicitly, just
JSON functions.  we can still work with that but it might be a little
different.

 if you can run tests and stuff, that would be even better, see
https://github.com/sqlalchemy/sqlalchemy/blob/master/README.unittests.rst
for the basic idea of that.

I've created an issue to track the effort at
https://github.com/sqlalchemy/sqlalchemy/issues/4384
On Wed, Nov 28, 2018 at 1:18 PM sanjeev kumar  wrote:
>
> I was looking for sql expression support but i didn’t find anything,so random 
> thought came why can’t contribute to.
> So if u give me any idea, to start things it will be very great
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> description.
> ---
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


[sqlalchemy] JSON Support for mssql 2016

2018-11-28 Thread sanjeev kumar
I was looking for sql expression support but i didn’t find anything,so random 
thought came why can’t contribute to.
So if u give me any idea, to start things it will be very great

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] JSON Support for mssql 2016

2018-11-28 Thread Mike Bayer
this can be contributed.

the basic idea can be emulated from the SQLite version of the type,
given in this change:

https://github.com/sqlalchemy/sqlalchemy/commit/62d59088dfe86d7ecabd85ad626ee108b668acc5

note the main reason you'd want to make a JSON type is because you
need the SQL expression support, like table.c.mycolumn['foo'] ==
'bar'.   if you just need to persist and load JSON, a simple
UserDefinedType
https://docs.sqlalchemy.org/en/latest/core/custom_types.html?highlight=userdefinedtype#creating-new-types
can get you that.the main thing to determine is if the driver
you're using, eg. pyodbc or pymssql, supports JSON natively, or if you
need to be doing the loads() / dumps() explicitly.

To sum up, two questions:

1. do you need SQL expression support  (or are you just looking to
contribute to SQLAlchemy in any case, in case, great!), or do you just
need to store and retrieve JSON objects right now.

2. do pyodbc/pymssql support JSON or do we have to send/receive
strings that we convert ourselves.

from those questions we can figure out the best strategy.

On Wed, Nov 28, 2018 at 9:41 AM sanjeev kumar  wrote:
>
> Do sqlalchemy  have support for MSsql 2016 JSON type.Or any project is going 
> on for same,if any how i can contribute to that project.
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> ---
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


[sqlalchemy] JSON Support for mssql 2016

2018-11-28 Thread sanjeev kumar
Do sqlalchemy  have support for MSsql 2016 JSON type.Or any project is 
going on for same,if any how i can contribute to that project.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.