Hi,

I am wondering if you were able to write the 4D dialect? I am in a similar 
predicament and will appreciate if you can help me in any way to write a 
dialect for 4D.

Thanks,
Prachi

On Friday, 19 February 2010 at 19:17:23 UTC James wrote:

> Anyone heard of 4D? Probably not, but I would love to work with
> SQLAlchemy and this database.
>
> How hard is it to write a new dialect?
>
> Anyone had luck using generic odbc (ie not mysql moduled to pyodbc) to
> connect to various "unsupported" databases?
>
> I've tried a couple connection strings, the biggest problem is 4D
> doesn't have a "database" name.
>
> # connect to the actual database
> from sqlalchemy import create_engine
> #using DSN
> engine = create_engine('mysql+pyodbc://4D_v11_Dev/DEFAULT_SCHEMA')
> #using URL
> engine = create_engine('mysql://user:pa...@127.0.0.1', module='pyodbc')
> #another dialect with DSN => ERROR: AttributeError: 'str' object has
> no attribute 'paramstyle'
> engine = create_engine('mssql://4D_v11_Dev', module='pyodbc')
> # yet another try
> engine = create_engine('mysql+pyodbc://4D_v11_Dev')
> # show me output
> engine.echo = True
>
> None of those work, I have some stack traces, but the gist is this:
> # when used without a database name
> sqlalchemy.exc.DBAPIError: (Error) ('08004', '[08004] Server rejected
> the connection:\nFailed to parse statement.\r (1301)
> (SQLExecDirectW)') 'SELECT DATABASE()' ()
>
> # when I try to specify a name
> sqlalchemy.exc.DBAPIError: (Error) ('00000', '[00000] [iODBC][Driver
> Manager]dlopen({MySQL}, 6): image not found (0) (SQLDriverConnectW)')
> None None
>
> But connection directly via pyodbc does work
> import pyodbc
> cnxn = pyodbc.connect("DSN=4D_v11_Dev;UID=user;PWD=pass")
> cursor = cnxn.cursor()
> cursor.execute('select * from ODBCTest')
> a=cursor.fetchall()
> print 'pyodbc',a
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/920ca28f-c544-4bd2-9795-b8907eee8224n%40googlegroups.com.

Reply via email to