Hi,
I'm new to SQLalchemy and alembic and I'm doing a proof of concept for 
migrations in Redshift.

Initially, using the regular postgresql dialect everything is fine.
But when I try to use the redshift_sqlalchemy dialect for the last bit of 
Redshift functionality, it goes caput.
And I've looked over SQLAlchemy and Alembic docs for any help on using 3rd 
Party dialects and I can't seem to get anywhere.

Environment:
The basic setup as told by the Tutorial

The following are installed in a virtualenv:
pip install alembic
pip install psycopg2
pip install redshift_sqlalchemy

I've tried to manually register the dialect:
from sqlalchemy.dialects import registry
registry.register("redshift", "redshift_sqlalchemy.dialect", 
"RedshiftDialect")
registry.register("redshift.psycopg2", "redshift_sqlalchemy.dialect", 
"RedshiftDialect")

And tried the following url setups in my alembic.ini (via alembic init)
sqlalchemy.url = redshift+psycopg2://user:pass@host:port/dbname
sqlalchemy.url = redshift://user:pass@host:port/dbname

Both error out the same as this trace out.

Traceback (most recent call last):
  File "/opt/virtualenvs/alembic/bin/alembic", line 9, in <module>
    load_entry_point('alembic==0.6.7', 'console_scripts', 'alembic')()
  File 
"/opt/virtualenvs/alembic/lib/python2.7/site-packages/alembic/config.py", 
line 306, in main
    CommandLine(prog=prog).main(argv=argv)
  File 
"/opt/virtualenvs/alembic/lib/python2.7/site-packages/alembic/config.py", 
line 300, in main
    self.run_cmd(cfg, options)
  File 
"/opt/virtualenvs/alembic/lib/python2.7/site-packages/alembic/config.py", 
line 286, in run_cmd
    **dict((k, getattr(options, k)) for k in kwarg)
  File 
"/opt/virtualenvs/alembic/lib/python2.7/site-packages/alembic/command.py", 
line 129, in upgrade
    script.run_env()
  File 
"/opt/virtualenvs/alembic/lib/python2.7/site-packages/alembic/script.py", 
line 208, in run_env
    util.load_python_file(self.dir, 'env.py')
  File 
"/opt/virtualenvs/alembic/lib/python2.7/site-packages/alembic/util.py", 
line 230, in load_python_file
    module = load_module_py(module_id, path)
  File 
"/opt/virtualenvs/alembic/lib/python2.7/site-packages/alembic/compat.py", 
line 63, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "dson_test/env.py", line 92, in <module>
    run_migrations_online()
  File "dson_test/env.py", line 80, in run_migrations_online
    target_metadata=target_metadata
  File "<string>", line 7, in configure
  File 
"/opt/virtualenvs/alembic/lib/python2.7/site-packages/alembic/environment.py", 
line 672, in configure
    opts=opts
  File 
"/opt/virtualenvs/alembic/lib/python2.7/site-packages/alembic/migration.py", 
line 158, in configure
    return MigrationContext(dialect, connection, opts, environment_context)
  File 
"/opt/virtualenvs/alembic/lib/python2.7/site-packages/alembic/migration.py", 
line 103, in __init__
    self.impl = ddl.DefaultImpl.get_by_dialect(dialect)(
  File 
"/opt/virtualenvs/alembic/lib/python2.7/site-packages/alembic/ddl/impl.py", 
line 55, in get_by_dialect
    return _impls[dialect.name]
KeyError: 'redshift'

What am I missing?

Thanks,
Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy-alembic+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to