without producing history events. [ticket:2582]
- [feature] ORM entities can be passed
- to select() as well as the select_from(),
+ to the core select() construct as well
+ as to the select_from(),
correlate(), and correlate_except()
- methods, where they will be unwrapped
+ methods of select(), where they will be unwrapped
into selectables. [ticket:2245]
- [feature] Some support for auto-rendering of a
+
+
+from . import autodoc_mods, dialect_info, sqlformatter, mako
+
+def setup(app):
+ app.add_config_value('release_date', "", True)
+ app.add_config_value('site_base', "", True)
+ app.add_config_value('build_number', "", 1)
+ mako.setup(app)
+ autodoc_mods.setup(app)
+ dialect_info.setup(app)
+ sqlformatter.setup(app)
--- /dev/null
+import re
+
+def autodoc_skip_member(app, what, name, obj, skip, options):
+ if what == 'class' and skip and \
+ name in ('__init__', '__eq__', '__ne__', '__lt__',
+ '__le__', '__call__') and \
+ obj.__doc__:
+ return False
+ else:
+ return skip
+
+# im sure this is in the app somewhere, but I don't really
+# know where, so we're doing it here.
+_track_autodoced = {}
+def autodoc_process_docstring(app, what, name, obj, options, lines):
+ if what == "class":
+ _track_autodoced[name] = obj
+ elif what in ("attribute", "method") and \
+ options.get("inherited-members"):
+ m = re.match(r'(.*?)\.([\w_]+)$', name)
+ if m:
+ clsname, attrname = m.group(1, 2)
+ if clsname in _track_autodoced:
+ cls = _track_autodoced[clsname]
+ for supercls in cls.__mro__:
+ if attrname in supercls.__dict__:
+ break
+ if supercls is not cls:
+ lines[:0] = [
+ ".. container:: inherited_member",
+ "",
+ " *inherited from the* :%s:`.%s.%s` *%s of* :class:`.%s`" % (
+ "attr" if what == "attribute"
+ else "meth",
+ supercls.__name__,
+ attrname,
+ what,
+ supercls.__name__
+ ),
+ ""
+ ]
+
+
+def setup(app):
+ app.connect('autodoc-skip-member', autodoc_skip_member)
+ app.connect('autodoc-process-docstring', autodoc_process_docstring)
+
+++ /dev/null
-from sphinx.application import TemplateBridge
-from sphinx.builders.html import StandaloneHTMLBuilder
-from sphinx.highlighting import PygmentsBridge
-from sphinx.jinja2glue import BuiltinTemplateLoader
-from pygments import highlight
-from pygments.lexer import RegexLexer, bygroups, using
-from pygments.token import *
-from pygments.filter import Filter, apply_filters
-from pygments.lexers import PythonLexer, PythonConsoleLexer
-from pygments.formatters import HtmlFormatter, LatexFormatter
-import re
-from mako.lookup import TemplateLookup
-from mako.template import Template
-from mako import __version__
-import os
-
-rtd = os.environ.get('READTHEDOCS', None) == 'True'
-
-class MakoBridge(TemplateBridge):
- def init(self, builder, *args, **kw):
- self.jinja2_fallback = BuiltinTemplateLoader()
- self.jinja2_fallback.init(builder, *args, **kw)
-
- builder.config.html_context['release_date'] = builder.config['release_date']
- builder.config.html_context['site_base'] = builder.config['site_base']
-
- self.lookup = TemplateLookup(directories=builder.config.templates_path,
- #format_exceptions=True,
- imports=[
- "from builder import util"
- ]
- )
-
- if rtd:
- import urllib2
- template_url = builder.config['site_base'] + "/docs_base.mako"
- template = urllib2.urlopen(template_url).read()
- self.lookup.put_string("/rtd_base.mako", template)
-
- def render(self, template, context):
- template = template.replace(".html", ".mako")
- context['prevtopic'] = context.pop('prev', None)
- context['nexttopic'] = context.pop('next', None)
- version = context['version']
- pathto = context['pathto']
-
- # RTD layout
- if rtd:
- # add variables if not present, such
- # as if local test of READTHEDOCS variable
- if 'MEDIA_URL' not in context:
- context['MEDIA_URL'] = "http://media.readthedocs.org/"
- if 'slug' not in context:
- context['slug'] = context['project'].lower()
- if 'url' not in context:
- context['url'] = "/some/test/url"
- if 'current_version' not in context:
- context['current_version'] = "latest"
-
- if 'name' not in context:
- context['name'] = context['project'].lower()
-
- context['rtd'] = True
- context['toolbar'] = True
- context['layout'] = "rtd_layout.mako"
- context['base'] = "rtd_base.mako"
- context['pdf_url'] = "%spdf/%s/%s/%s.pdf" % (
- context['MEDIA_URL'],
- context['slug'],
- context['current_version'],
- context['slug']
- )
- # local docs layout
- else:
- context['rtd'] = False
- context['toolbar'] = False
- context['layout'] = "layout.mako"
- context['base'] = "static_base.mako"
-
- context.setdefault('_', lambda x:x)
- return self.lookup.get_template(template).render_unicode(**context)
-
- def render_string(self, template, context):
- # this is used for .js, .css etc. and we don't have
- # local copies of that stuff here so use the jinja render.
- return self.jinja2_fallback.render_string(template, context)
-
-class StripDocTestFilter(Filter):
- def filter(self, lexer, stream):
- for ttype, value in stream:
- if ttype is Token.Comment and re.match(r'#\s*doctest:', value):
- continue
- yield ttype, value
-
-class PyConWithSQLLexer(RegexLexer):
- name = 'PyCon+SQL'
- aliases = ['pycon+sql']
-
- flags = re.IGNORECASE | re.DOTALL
-
- tokens = {
- 'root': [
- (r'{sql}', Token.Sql.Link, 'sqlpopup'),
- (r'{opensql}', Token.Sql.Open, 'opensqlpopup'),
- (r'.*?\n', using(PythonConsoleLexer))
- ],
- 'sqlpopup':[
- (
- r'(.*?\n)((?:PRAGMA|BEGIN|SELECT|INSERT|DELETE|ROLLBACK|COMMIT|ALTER|UPDATE|CREATE|DROP|PRAGMA|DESCRIBE).*?(?:{stop}\n?|$))',
- bygroups(using(PythonConsoleLexer), Token.Sql.Popup),
- "#pop"
- )
- ],
- 'opensqlpopup':[
- (
- r'.*?(?:{stop}\n*|$)',
- Token.Sql,
- "#pop"
- )
- ]
- }
-
-
-class PythonWithSQLLexer(RegexLexer):
- name = 'Python+SQL'
- aliases = ['pycon+sql']
-
- flags = re.IGNORECASE | re.DOTALL
-
- tokens = {
- 'root': [
- (r'{sql}', Token.Sql.Link, 'sqlpopup'),
- (r'{opensql}', Token.Sql.Open, 'opensqlpopup'),
- (r'.*?\n', using(PythonLexer))
- ],
- 'sqlpopup':[
- (
- r'(.*?\n)((?:PRAGMA|BEGIN|SELECT|INSERT|DELETE|ROLLBACK|COMMIT|ALTER|UPDATE|CREATE|DROP|PRAGMA|DESCRIBE).*?(?:{stop}\n?|$))',
- bygroups(using(PythonLexer), Token.Sql.Popup),
- "#pop"
- )
- ],
- 'opensqlpopup':[
- (
- r'.*?(?:{stop}\n*|$)',
- Token.Sql,
- "#pop"
- )
- ]
- }
-
-
-def _strip_trailing_whitespace(iter_):
- buf = list(iter_)
- if buf:
- buf[-1] = (buf[-1][0], buf[-1][1].rstrip())
- for t, v in buf:
- yield t, v
-
-class PopupSQLFormatter(HtmlFormatter):
- def _format_lines(self, tokensource):
- buf = []
- for ttype, value in apply_filters(tokensource, [StripDocTestFilter()]):
- if ttype in Token.Sql:
- for t, v in HtmlFormatter._format_lines(self, iter(buf)):
- yield t, v
- buf = []
-
- if ttype is Token.Sql:
- yield 1, "<div class='show_sql'>%s</div>" % re.sub(r'(?:[{stop}|\n]*)$', '', value)
- elif ttype is Token.Sql.Link:
- yield 1, "<a href='#' class='sql_link'>sql</a>"
- elif ttype is Token.Sql.Popup:
- yield 1, "<div class='popup_sql'>%s</div>" % re.sub(r'(?:[{stop}|\n]*)$', '', value)
- else:
- buf.append((ttype, value))
-
- for t, v in _strip_trailing_whitespace(HtmlFormatter._format_lines(self, iter(buf))):
- yield t, v
-
-class PopupLatexFormatter(LatexFormatter):
- def _filter_tokens(self, tokensource):
- for ttype, value in apply_filters(tokensource, [StripDocTestFilter()]):
- if ttype in Token.Sql:
- if ttype is not Token.Sql.Link and ttype is not Token.Sql.Open:
- yield Token.Literal, re.sub(r'{stop}', '', value)
- else:
- continue
- else:
- yield ttype, value
-
- def format(self, tokensource, outfile):
- LatexFormatter.format(self, self._filter_tokens(tokensource), outfile)
-
-def autodoc_skip_member(app, what, name, obj, skip, options):
- if what == 'class' and skip and \
- name in ('__init__', '__eq__', '__ne__', '__lt__', '__le__', '__call__') and \
- obj.__doc__:
- return False
- else:
- return skip
-
-# im sure this is in the app somewhere, but I don't really
-# know where, so we're doing it here.
-_track_autodoced = {}
-def autodoc_process_docstring(app, what, name, obj, options, lines):
- if what == "class":
- _track_autodoced[name] = obj
- elif what in ("attribute", "method") and \
- options.get("inherited-members"):
- m = re.match(r'(.*?)\.([\w_]+)$', name)
- if m:
- clsname, attrname = m.group(1, 2)
- if clsname in _track_autodoced:
- cls = _track_autodoced[clsname]
- for supercls in cls.__mro__:
- if attrname in supercls.__dict__:
- break
- if supercls is not cls:
- lines[:0] = [
- ".. container:: inherited_member",
- "",
- " *inherited from the* :%s:`.%s.%s` *%s of* :class:`.%s`" % (
- "attr" if what == "attribute"
- else "meth",
- supercls.__name__,
- attrname,
- what,
- supercls.__name__
- ),
- ""
- ]
-
-def setup(app):
- app.add_lexer('pycon+sql', PyConWithSQLLexer())
- app.add_lexer('python+sql', PythonWithSQLLexer())
- app.add_config_value('release_date', "", True)
- app.add_config_value('site_base', "", True)
- app.add_config_value('build_number', "", 1)
- app.connect('autodoc-skip-member', autodoc_skip_member)
- app.connect('autodoc-process-docstring', autodoc_process_docstring)
- PygmentsBridge.html_formatter = PopupSQLFormatter
- PygmentsBridge.latex_formatter = PopupLatexFormatter
-
--- /dev/null
+import re
+from sphinx.util.compat import Directive
+from docutils import nodes
+
+class DialectDirective(Directive):
+ has_content = True
+
+ _dialects = {}
+
+ def _parse_content(self):
+ d = {}
+ d['default'] = self.content[0]
+ d['text'] = []
+ idx = 0
+ for line in self.content[1:]:
+ idx += 1
+ m = re.match(r'\:(.+?)\: +(.+)', line)
+ if m:
+ attrname, value = m.group(1, 2)
+ d[attrname] = value
+ else:
+ break
+ d["text"] = self.content[idx + 1:]
+ return d
+
+ def _dbapi_node(self):
+
+ dialect_name, dbapi_name = self.dialect_name.split("+")
+
+ try:
+ dialect_directive = self._dialects[dialect_name]
+ except KeyError:
+ raise Exception("No .. dialect:: %s directive has been established"
+ % dialect_name)
+
+ output = []
+
+ content = self._parse_content()
+
+ parent_section_ref = self.state.parent.children[0]['ids'][0]
+ self._append_dbapi_bullet(dialect_name, dbapi_name,
+ content['name'], parent_section_ref)
+
+ p = nodes.paragraph('', '',
+ nodes.Text(
+ "Support for the %s database via the %s driver." % (
+ dialect_directive.database_name,
+ content['name']
+ ),
+ "Support for the %s database via the %s driver." % (
+ dialect_directive.database_name,
+ content['name']
+ )
+ ),
+ )
+
+ self.state.nested_parse(content['text'], 0, p)
+ output.append(p)
+
+ if "url" in content or "driverurl" in content:
+ sec = nodes.section(
+ '',
+ nodes.title("DBAPI", "DBAPI"),
+ ids=["dialect-%s-%s-url" % (dialect_name, dbapi_name)]
+ )
+ if "url" in content:
+ text = "%s is available at:\n" % dbapi_name
+ uri = content['url']
+ sec.append(
+ nodes.paragraph('', '',
+ nodes.Text(text, text),
+ nodes.reference('', '',
+ nodes.Text(uri, uri),
+ refuri=uri,
+ )
+ )
+ )
+ if "driverurl" in content:
+ text = "Drivers for this database are available at:\n"
+ sec.append(
+ nodes.paragraph('', '',
+ nodes.Text(text, text),
+ nodes.reference('', '',
+ nodes.Text(content['driverurl'], content['driverurl']),
+ refuri=content['driverurl']
+ )
+ )
+ )
+ output.append(sec)
+
+
+ if "connectstring" in content:
+ # TODO: wish I knew how to just embed RST here and parse it into
+ # nodes
+ sec = nodes.section(
+ '',
+ nodes.title("Connecting", "Connecting"),
+ nodes.paragraph('', '',
+ nodes.Text("Connect String:", "Connect String:"),
+ nodes.literal_block(content['connectstring'],
+ content['connectstring'])
+ ),
+ ids=["dialect-%s-%s-connect" % (dialect_name, dbapi_name)]
+ )
+ output.append(sec)
+
+ return output
+
+ def _dialect_node(self):
+ self._dialects[self.dialect_name] = self
+
+ content = self._parse_content()
+ self.database_name = content['name']
+
+ self.bullets = nodes.bullet_list()
+ text = "The following dialect/DBAPI options are available. "\
+ "Please refer to individual DBAPI sections for connect information."
+ sec = nodes.section('',
+ nodes.paragraph('', '',
+ nodes.Text(
+ "Support for the %s database." % content['name'],
+ "Support for the %s database." % content['name']
+ ),
+ ),
+ nodes.title("DBAPI Support", "DBAPI Support"),
+ nodes.paragraph('', '',
+ nodes.Text(text, text),
+ self.bullets
+ ),
+ ids=["dialect-%s" % self.dialect_name]
+ )
+
+ return [sec]
+
+ def _append_dbapi_bullet(self, dialect_name, dbapi_name, name, idname):
+ env = self.state.document.settings.env
+ dialect_directive = self._dialects[dialect_name]
+
+ list_node = nodes.list_item('',
+ nodes.paragraph('', '',
+ nodes.reference('', '',
+ nodes.Text(name, name),
+ refdocname=self.docname,
+ refuri=env.app.builder.get_relative_uri(
+ dialect_directive.docname, self.docname) +
+ "#" + idname
+ ),
+ #nodes.Text(" ", " "),
+ #nodes.reference('', '',
+ # nodes.Text("(connectstring)", "(connectstring)"),
+ # refdocname=self.docname,
+ # refuri=env.app.builder.get_relative_uri(
+ # dialect_directive.docname, self.docname) +
+ ## "#" + ("dialect-%s-%s-connect" %
+ # (dialect_name, dbapi_name))
+ # )
+ )
+ )
+ dialect_directive.bullets.append(list_node)
+
+ def run(self):
+ env = self.state.document.settings.env
+ self.docname = env.docname
+
+ self.dialect_name = dialect_name = self.content[0]
+
+ has_dbapi = "+" in dialect_name
+ if has_dbapi:
+ return self._dbapi_node()
+ else:
+ return self._dialect_node()
+
+def setup(app):
+ app.add_directive('dialect', DialectDirective)
+
--- /dev/null
+from __future__ import absolute_import
+
+from sphinx.application import TemplateBridge
+from sphinx.jinja2glue import BuiltinTemplateLoader
+from mako.lookup import TemplateLookup
+import os
+
+rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
+class MakoBridge(TemplateBridge):
+ def init(self, builder, *args, **kw):
+ self.jinja2_fallback = BuiltinTemplateLoader()
+ self.jinja2_fallback.init(builder, *args, **kw)
+
+ builder.config.html_context['release_date'] = builder.config['release_date']
+ builder.config.html_context['site_base'] = builder.config['site_base']
+
+ self.lookup = TemplateLookup(directories=builder.config.templates_path,
+ #format_exceptions=True,
+ imports=[
+ "from builder import util"
+ ]
+ )
+
+ if rtd:
+ import urllib2
+ template_url = builder.config['site_base'] + "/docs_base.mako"
+ template = urllib2.urlopen(template_url).read()
+ self.lookup.put_string("/rtd_base.mako", template)
+
+ def render(self, template, context):
+ template = template.replace(".html", ".mako")
+ context['prevtopic'] = context.pop('prev', None)
+ context['nexttopic'] = context.pop('next', None)
+
+ # RTD layout
+ if rtd:
+ # add variables if not present, such
+ # as if local test of READTHEDOCS variable
+ if 'MEDIA_URL' not in context:
+ context['MEDIA_URL'] = "http://media.readthedocs.org/"
+ if 'slug' not in context:
+ context['slug'] = context['project'].lower()
+ if 'url' not in context:
+ context['url'] = "/some/test/url"
+ if 'current_version' not in context:
+ context['current_version'] = "latest"
+
+ if 'name' not in context:
+ context['name'] = context['project'].lower()
+
+ context['rtd'] = True
+ context['toolbar'] = True
+ context['layout'] = "rtd_layout.mako"
+ context['base'] = "rtd_base.mako"
+ context['pdf_url'] = "%spdf/%s/%s/%s.pdf" % (
+ context['MEDIA_URL'],
+ context['slug'],
+ context['current_version'],
+ context['slug']
+ )
+ # local docs layout
+ else:
+ context['rtd'] = False
+ context['toolbar'] = False
+ context['layout'] = "layout.mako"
+ context['base'] = "static_base.mako"
+
+ context.setdefault('_', lambda x: x)
+ return self.lookup.get_template(template).render_unicode(**context)
+
+ def render_string(self, template, context):
+ # this is used for .js, .css etc. and we don't have
+ # local copies of that stuff here so use the jinja render.
+ return self.jinja2_fallback.render_string(template, context)
+
+def setup(app):
+ app.config['template_bridge'] = "builder.mako.MakoBridge"
+
--- /dev/null
+from pygments.lexer import RegexLexer, bygroups, using
+from pygments.token import Token
+from pygments.filter import Filter
+from pygments.filter import apply_filters
+from pygments.lexers import PythonLexer, PythonConsoleLexer
+from sphinx.highlighting import PygmentsBridge
+from pygments.formatters import HtmlFormatter, LatexFormatter
+
+import re
+
+
+def _strip_trailing_whitespace(iter_):
+ buf = list(iter_)
+ if buf:
+ buf[-1] = (buf[-1][0], buf[-1][1].rstrip())
+ for t, v in buf:
+ yield t, v
+
+
+class StripDocTestFilter(Filter):
+ def filter(self, lexer, stream):
+ for ttype, value in stream:
+ if ttype is Token.Comment and re.match(r'#\s*doctest:', value):
+ continue
+ yield ttype, value
+
+class PyConWithSQLLexer(RegexLexer):
+ name = 'PyCon+SQL'
+ aliases = ['pycon+sql']
+
+ flags = re.IGNORECASE | re.DOTALL
+
+ tokens = {
+ 'root': [
+ (r'{sql}', Token.Sql.Link, 'sqlpopup'),
+ (r'{opensql}', Token.Sql.Open, 'opensqlpopup'),
+ (r'.*?\n', using(PythonConsoleLexer))
+ ],
+ 'sqlpopup': [
+ (
+ r'(.*?\n)((?:PRAGMA|BEGIN|SELECT|INSERT|DELETE|ROLLBACK|'
+ 'COMMIT|ALTER|UPDATE|CREATE|DROP|PRAGMA'
+ '|DESCRIBE).*?(?:{stop}\n?|$))',
+ bygroups(using(PythonConsoleLexer), Token.Sql.Popup),
+ "#pop"
+ )
+ ],
+ 'opensqlpopup': [
+ (
+ r'.*?(?:{stop}\n*|$)',
+ Token.Sql,
+ "#pop"
+ )
+ ]
+ }
+
+
+class PythonWithSQLLexer(RegexLexer):
+ name = 'Python+SQL'
+ aliases = ['pycon+sql']
+
+ flags = re.IGNORECASE | re.DOTALL
+
+ tokens = {
+ 'root': [
+ (r'{sql}', Token.Sql.Link, 'sqlpopup'),
+ (r'{opensql}', Token.Sql.Open, 'opensqlpopup'),
+ (r'.*?\n', using(PythonLexer))
+ ],
+ 'sqlpopup': [
+ (
+ r'(.*?\n)((?:PRAGMA|BEGIN|SELECT|INSERT|DELETE|ROLLBACK'
+ '|COMMIT|ALTER|UPDATE|CREATE|DROP'
+ '|PRAGMA|DESCRIBE).*?(?:{stop}\n?|$))',
+ bygroups(using(PythonLexer), Token.Sql.Popup),
+ "#pop"
+ )
+ ],
+ 'opensqlpopup': [
+ (
+ r'.*?(?:{stop}\n*|$)',
+ Token.Sql,
+ "#pop"
+ )
+ ]
+ }
+
+class PopupSQLFormatter(HtmlFormatter):
+ def _format_lines(self, tokensource):
+ buf = []
+ for ttype, value in apply_filters(tokensource, [StripDocTestFilter()]):
+ if ttype in Token.Sql:
+ for t, v in HtmlFormatter._format_lines(self, iter(buf)):
+ yield t, v
+ buf = []
+
+ if ttype is Token.Sql:
+ yield 1, "<div class='show_sql'>%s</div>" % \
+ re.sub(r'(?:[{stop}|\n]*)$', '', value)
+ elif ttype is Token.Sql.Link:
+ yield 1, "<a href='#' class='sql_link'>sql</a>"
+ elif ttype is Token.Sql.Popup:
+ yield 1, "<div class='popup_sql'>%s</div>" % \
+ re.sub(r'(?:[{stop}|\n]*)$', '', value)
+ else:
+ buf.append((ttype, value))
+
+ for t, v in _strip_trailing_whitespace(
+ HtmlFormatter._format_lines(self, iter(buf))):
+ yield t, v
+
+class PopupLatexFormatter(LatexFormatter):
+ def _filter_tokens(self, tokensource):
+ for ttype, value in apply_filters(tokensource, [StripDocTestFilter()]):
+ if ttype in Token.Sql:
+ if ttype is not Token.Sql.Link and ttype is not Token.Sql.Open:
+ yield Token.Literal, re.sub(r'{stop}', '', value)
+ else:
+ continue
+ else:
+ yield ttype, value
+
+ def format(self, tokensource, outfile):
+ LatexFormatter.format(self, self._filter_tokens(tokensource), outfile)
+
+def setup(app):
+ app.add_lexer('pycon+sql', PyConWithSQLLexer())
+ app.add_lexer('python+sql', PythonWithSQLLexer())
+
+ PygmentsBridge.html_formatter = PopupSQLFormatter
+ PygmentsBridge.latex_formatter = PopupLatexFormatter
+
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
#extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode',
-# 'sphinx.ext.doctest', 'builder.builders']
+# 'sphinx.ext.doctest', 'builder']
extensions = ['sphinx.ext.autodoc',
- 'sphinx.ext.doctest', 'builder.builders']
+ 'sphinx.ext.doctest', 'builder']
# Add any paths that contain templates here, relative to this directory.
# not sure why abspath() is needed here, some users
# The suffix of source filenames.
source_suffix = '.rst'
-template_bridge = "builder.builders.MakoBridge"
# The encoding of source files.
#source_encoding = 'utf-8-sig'
:show-inheritance:
-.. _drizzle_mysqldb:
-
-MySQL-Python Notes
---------------------
+MySQL-Python
+------------
.. automodule:: sqlalchemy.dialects.drizzle.mysqldb
.. automodule:: sqlalchemy.dialects.firebird.base
-.. _kinterbasdb:
-
kinterbasdb
-----------
.. automodule:: sqlalchemy.dialects.informix.base
-informixdb Notes
---------------------
+informixdb
+----------
.. automodule:: sqlalchemy.dialects.informix.informixdb
\ No newline at end of file
SMALLINT, SMALLMONEY, SQL_VARIANT, TEXT, TIME, \
TIMESTAMP, TINYINT, UNIQUEIDENTIFIER, VARBINARY, VARCHAR
-Types which are specific to SQL Server, or have SQL Server-specific
+Types which are specific to SQL Server, or have SQL Server-specific
construction arguments, are as follows:
.. currentmodule:: sqlalchemy.dialects.mssql
-------
.. automodule:: sqlalchemy.dialects.mssql.pymssql
-zxjdbc Notes
+zxjdbc
--------------
.. automodule:: sqlalchemy.dialects.mssql.zxjdbc
:members: __init__
:show-inheritance:
-.. _mysqldb:
-
MySQL-Python
--------------------
.. automodule:: sqlalchemy.dialects.mysql.mysqldb
-.. _oursql:
-
OurSQL
--------------
.. automodule:: sqlalchemy.dialects.mysql.oursql
-.. _pymysql:
-
pymysql
-------------
.. automodule:: sqlalchemy.dialects.mysql.pymysql
-.. _mysqlconnector:
-
MySQL-Connector
----------------------
.. automodule:: sqlalchemy.dialects.mysql.mysqlconnector
-.. _gaerdbms:
-
Google App Engine
-----------------------
.. automodule:: sqlalchemy.dialects.mysql.gaerdbms
-.. _mysql_pyodbc:
-
pyodbc
---------------
+------
.. automodule:: sqlalchemy.dialects.mysql.pyodbc
-.. _mysql_zxjdbc:
-
zxjdbc
--------------
NUMBER, NVARCHAR, NVARCHAR2, RAW, TIMESTAMP, VARCHAR, \
VARCHAR2
-Types which are specific to Oracle, or have Oracle-specific
+Types which are specific to Oracle, or have Oracle-specific
construction arguments, are as follows:
.. currentmodule:: sqlalchemy.dialects.oracle
:members: __init__
:show-inheritance:
-cx_Oracle Notes
----------------
+cx_Oracle
+----------
.. automodule:: sqlalchemy.dialects.oracle.cx_oracle
-zxjdbc Notes
---------------
+zxjdbc
+-------
.. automodule:: sqlalchemy.dialects.oracle.zxjdbc
.. automodule:: sqlalchemy.dialects.postgresql.psycopg2
-
-.. _pypostgresql:
-
py-postgresql
--------------------
.. automodule:: sqlalchemy.dialects.postgresql.pypostgresql
-.. _pg8000:
-
pg8000
--------------
.. automodule:: sqlalchemy.dialects.postgresql.pg8000
-.. _zxjdbc:
-
zxjdbc
--------------
.. automodule:: sqlalchemy.dialects.sybase.base
-python-sybase notes
+python-sybase
-------------------
.. automodule:: sqlalchemy.dialects.sybase.pysybase
-pyodbc notes
+pyodbc
------------
.. automodule:: sqlalchemy.dialects.sybase.pyodbc
-mxodbc notes
+mxodbc
------------
.. automodule:: sqlalchemy.dialects.sybase.mxodbc
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the Drizzle database.
+"""
+
+.. dialect:: drizzle
+ :name: Drizzle
Drizzle is a variant of MySQL. Unlike MySQL, Drizzle's default storage engine
is InnoDB (transactions, foreign-keys) rather than MyISAM. For more
The SQLAlchemy Drizzle dialect leans heavily on the MySQL dialect, so much of
the :doc:`SQLAlchemy MySQL <mysql>` documentation is also relevant.
-DBAPI Support
--------------
-
-The following dialect/driver options are available:
-
-``drizzle://``- uses mysqldb_
-
-``drizzle+mysqldb://`` - uses mysqldb_
"""
-"""Support for the Drizzle database via the mysql-python adapter.
-
-MySQL-Python is available at:
-
- http://sourceforge.net/projects/mysql-python
-
-Connecting
------------
-
-Connect string format::
+"""
+.. dialect:: drizzle+mysqldb
+ :name: MySQL-Python
+ :dbapi: mysqldb
+ :connectstring: drizzle+mysqldb://<user>:<password>@<host>[:<port>]/<dbname>
+ :url: http://sourceforge.net/projects/mysql-python
- drizzle+mysqldb://<user>:<password>@<host>[:<port>]/<dbname>
"""
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
-Support for the Firebird database.
-DBAPI Support
--------------
-
-The following dialect/driver options are available:
-
-``firebird://``- uses kinterbasdb_
-
-``firebird+kinterbasdb://`` - uses kinterbasdb_
-
-``firebird+fdb://`` - uses fdb_
+.. dialect:: firebird
+ :name: Firebird
Firebird Dialects
-----------------
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
-fdb is a kinterbasdb compatible DBAPI for Firebird.
+.. dialect:: firebird+fdb
+ :name: fdb
+ :dbapi: pyodbc
+ :connectstring: firebird+fdb://user:password@host:port/path/to/db[?key=value&key=value...]
+ :url: http://pypi.python.org/pypi/fdb/
-.. versionadded:: 0.8 - Support for the fdb Firebird driver.
+ fdb is a kinterbasdb compatible DBAPI for Firebird.
-DBAPI
------
-
-http://pypi.python.org/pypi/fdb/
-
-Connecting
------------
-
-Connect string format::
-
- firebird+fdb://user:password@host:port/path/to/db[?key=value&key=value...]
+ .. versionadded:: 0.8 - Support for the fdb Firebird driver.
Status
------
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
-
-DBAPI
------
-
-http://firebirdsql.org/index.php?op=devel&sub=python
-
-Connecting
------------
-
-Connect string format::
-
- firebird+kinterbasdb://user:password@host:port/path/to/db[?key=value&key=value...]
+.. dialect:: firebird+kinterbasdb
+ :name: kinterbasdb
+ :dbapi: kinterbasdb
+ :connectstring: firebird+kinterbasdb://user:password@host:port/path/to/db[?key=value&key=value...]
+ :url: http://firebirdsql.org/index.php?op=devel&sub=python
Arguments
----------
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the Informix database.
+"""
+.. dialect:: informix
+ :name: Informix
.. note::
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
-Support for the informixdb DBAPI.
-informixdb is available at:
-
- http://informixdb.sourceforge.net/
-
-Connecting
-^^^^^^^^^^
-
-Sample informix connection::
-
- engine = create_engine('informix+informixdb://user:password@host/dbname')
+.. dialect:: informix+informixdb
+ :name: informixdb
+ :dbapi: informixdb
+ :connectstring: informix+informixdb://user:password@host/dbname
+ :url: http://informixdb.sourceforge.net/
"""
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
-The adodbapi dialect is not implemented for 0.6 at this time.
+.. dialect:: mssql+adodbapi
+ :name: adodbapi
+ :dbapi: adodbapi
+ :connectstring: mssql+adodbapi://<username>:<password>@<dsnname>
+ :url: http://adodbapi.sourceforge.net/
+
+.. note::
+
+ The adodbapi dialect is not implemented SQLAlchemy versions 0.6 and
+ above at this time.
"""
import datetime
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the Microsoft SQL Server database.
+"""
+.. dialect:: mssql
+ :name: Microsoft SQL Server
Auto Increment Behavior
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
-Support for MS-SQL via mxODBC.
-
-mxODBC is available at:
-
- http://www.egenix.com/
-
-This was tested with mxODBC 3.1.2 and the SQL Server Native
-Client connected to MSSQL 2005 and 2008 Express Editions.
-
-Connecting
-~~~~~~~~~~
-
-Connection is via DSN::
-
- mssql+mxodbc://<username>:<password>@<dsnname>
+.. dialect:: mssql+mxodbc
+ :name: mxODBC
+ :dbapi: mxodbc
+ :connectstring: mssql+mxodbc://<username>:<password>@<dsnname>
+ :url: http://www.egenix.com/
Execution Modes
-~~~~~~~~~~~~~~~
+---------------
mxODBC features two styles of statement execution, using the
``cursor.execute()`` and ``cursor.executedirect()`` methods (the second being
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
-Support for the pymssql dialect.
-
-This dialect supports pymssql 1.0 and greater.
-
-pymssql is available at:
-
- http://pymssql.sourceforge.net/
-
-Connecting
-^^^^^^^^^^
-
-Sample connect string::
-
- mssql+pymssql://<username>:<password>@<freetds_name>
-
-Adding "?charset=utf8" or similar will cause pymssql to return
-strings as Python unicode objects. This can potentially improve
-performance in some scenarios as decoding of strings is
-handled natively.
+.. dialect:: mssql+pymssql
+ :name: pymssql
+ :dbapi: pymssql
+ :connectstring: mssql+pymssql://<username>:<password>@<freetds_name>?charset=utf8
+ :url: http://pymssql.sourceforge.net/
Limitations
-^^^^^^^^^^^
+-----------
pymssql inherits a lot of limitations from FreeTDS, including:
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
-Support for MS-SQL via pyodbc.
+.. dialect:: mssql+pyodbc
+ :name: PyODBC
+ :dbapi: pyodbc
+ :connectstring: mssql+pyodbc://<username>:<password>@<dsnname>
+ :url: http://pypi.python.org/pypi/pyodbc/
-pyodbc is available at:
-
- http://pypi.python.org/pypi/pyodbc/
-
-Connecting
-^^^^^^^^^^
+Additional Connection Examples
+-------------------------------
Examples of pyodbc connection string URLs:
'dsn%3Dmydsn%3BDatabase%3Ddb'
Unicode Binds
-^^^^^^^^^^^^^
+-------------
The current state of PyODBC on a unix backend with FreeTDS and/or
EasySoft is poor regarding unicode; different OS platforms and versions of UnixODBC
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the Microsoft SQL Server database via the zxjdbc JDBC
-connector.
-
-JDBC Driver
------------
-
-Requires the jTDS driver, available from: http://jtds.sourceforge.net/
-
-Connecting
-----------
-
-URLs are of the standard form of
-``mssql+zxjdbc://user:pass@host:port/dbname[?key=value&key=value...]``.
+"""
+.. dialect:: mssql+zxjdbc
+ :name: zxJDBC for Jython
+ :dbapi: zxjdbc
+ :connectstring: mssql+zxjdbc://user:pass@host:port/dbname[?key=value&key=value...]
+ :driverurl: http://jtds.sourceforge.net/
-Additional arguments which may be specified either as query string
-arguments on the URL, or as keyword arguments to
-:func:`~sqlalchemy.create_engine()` will be passed as Connection
-properties to the underlying JDBC driver.
"""
from ...connectors.zxJDBC import ZxJDBCConnector
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the MySQL database.
-
-DBAPI Support
--------------
-
-The following dialect/driver options are available:
-
-* :ref:`mysqldb`
-
-* :ref:`mysqlconnector`
-
-* :ref:`oursql`
-
-* :ref:`gaerdbms`
-
-* :ref:`pymysql`
-
-* :ref:`mysql_pyodbc`
-
-* :ref:`mysql_zxjdbc`
+"""
+.. dialect:: mysql
+ :name: MySQL
Supported Versions and Features
-------------------------------
See the official MySQL documentation for detailed information about features
supported in any given server release.
-Connecting
-----------
-
-See the API documentation on individual drivers for details on connecting.
-
Connection Timeouts
-------------------
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for Google Cloud SQL on Google App Engine.
-
-This dialect is based primarily on the :mod:`.mysql.mysqldb` dialect with minimal
-changes.
-
-.. versionadded:: 0.7.8
-
-DBAPI
------
-
- https://developers.google.com/appengine/docs/python/cloud-sql/developers-guide
-
-Connecting
-----------
-
-Connect string format::
+"""
+.. dialect:: mysql+gaerdbms
+ :name: Google Cloud SQL
+ :dbapi: rdbms
+ :connectstring: mysql+gaerdbms:///<dbname>?instance=instancename
+ :url: https://developers.google.com/appengine/docs/python/cloud-sql/developers-guide
- mysql+gaerdbms:///<dbname>
+ This dialect is based primarily on the :mod:`.mysql.mysqldb` dialect with minimal
+ changes.
-E.g.::
+ .. versionadded:: 0.7.8
- create_engine('mysql+gaerdbms:///mydb',
- connect_args={"instance":"instancename"})
Pooling
-------
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the MySQL database via the MySQL Connector/Python adapter.
-
-DBAPI
------
-
-MySQL Connector/Python is available at:
-
- https://launchpad.net/myconnpy
-
-Connecting
------------
-
-Connect string format::
+"""
+.. dialect:: mysql+mysqlconnector
+ :name: MySQL Connector/Python
+ :dbapi: myconnpy
+ :connectstring: mysql+mysqlconnector://<user>:<password>@<host>[:<port>]/<dbname>
+ :url: https://launchpad.net/myconnpy
- mysql+mysqlconnector://<user>:<password>@<host>[:<port>]/<dbname>
"""
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the MySQL database via the MySQL-python adapter.
-
-DBAPI
------
-
-MySQL-Python is available at:
-
- http://sourceforge.net/projects/mysql-python
-
-Connecting
------------
+"""
-Connect string format::
+.. dialect:: mysql+mysqldb
+ :name: MySQL-Python
+ :dbapi: mysqldb
+ :connectstring: mysql+mysqldb://<user>:<password>@<host>[:<port>]/<dbname>
+ :url: http://sourceforge.net/projects/mysql-python
- mysql+mysqldb://<user>:<password>@<host>[:<port>]/<dbname>
Unicode
-------
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the MySQL database via the oursql adapter.
-
-DBAPI
------
-
-OurSQL is available at:
-
- http://packages.python.org/oursql/
-
-Connecting
------------
-
-Connect string format::
+"""
- mysql+oursql://<user>:<password>@<host>[:<port>]/<dbname>
+.. dialect:: mysql+oursql
+ :name: OurSQL
+ :dbapi: oursql
+ :connectstring: mysql+oursql://<user>:<password>@<host>[:<port>]/<dbname>
+ :url: http://packages.python.org/oursql/
Unicode
-------
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the MySQL database via the pymysql adapter.
-
-DBAPI
------
-
-pymysql is available at:
-
- http://code.google.com/p/pymysql/
-
-Connecting
-----------
-
-Connect string::
+"""
- mysql+pymysql://<username>:<password>@<host>/<dbname>[?<options>]
+.. dialect:: mysql+pymysql
+ :name: PyMySQL
+ :dbapi: pymysql
+ :connectstring: mysql+pymysql://<username>:<password>@<host>/<dbname>[?<options>]
+ :url: http://code.google.com/p/pymysql/
MySQL-Python Compatibility
--------------------------
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the MySQL database via the pyodbc adapter.
-
-DBAPI
------
-
-pyodbc is available at:
-
- http://pypi.python.org/pypi/pyodbc/
+"""
-Connecting
-----------
-Connect string::
+.. dialect:: mysql+pyodbc
+ :name: PyODBC
+ :dbapi: pyodbc
+ :connectstring: mysql+pyodbc://<username>:<password>@<dsnname>
+ :url: http://pypi.python.org/pypi/pyodbc/
- mysql+pyodbc://<username>:<password>@<dsnname>
Limitations
-----------
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the MySQL database via Jython's zxjdbc JDBC connector.
-
-DBAPI
------
-
-The official MySQL JDBC driver is at
-http://dev.mysql.com/downloads/connector/j/.
-
-Connecting
-----------
-
-Connect string::
+"""
- mysql+zxjdbc://<user>:<password>@<hostname>[:<port>]/<database>
+.. dialect:: mysql+zxjdbc
+ :name: zxjdbc for Jython
+ :dbapi: zxjdbc
+ :connectstring: mysql+zxjdbc://<user>:<password>@<hostname>[:<port>]/<database>
+ :driverurl: http://dev.mysql.com/downloads/connector/j/
Character Sets
--------------
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the Oracle database.
+"""
+.. dialect:: oracle
+ :name: Oracle
-Oracle version 8 through current (11g at the time of this writing) are supported.
+ Oracle version 8 through current (11g at the time of this writing) are supported.
Connect Arguments
-----------------
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the Oracle database via the cx_oracle driver.
-
-Driver
-------
+"""
-The Oracle dialect uses the cx_oracle driver, available at
-http://cx-oracle.sourceforge.net/ . The dialect has several behaviors
-which are specifically tailored towards compatibility with this module.
-Version 5.0 or greater is **strongly** recommended, as SQLAlchemy makes
-extensive use of the cx_oracle output converters for numeric and
-string conversions.
+.. dialect:: oracle+cx_oracle
+ :name: cx-Oracle
+ :dbapi: cx_oracle
+ :connectstring: oracle+cx_oracle://user:pass@host:port/dbname[?key=value&key=value...]
+ :url: http://cx-oracle.sourceforge.net/
-Connecting
-----------
+Additional Connect Arguments
+----------------------------
-Connecting with create_engine() uses the standard URL approach of
-``oracle://user:pass@host:port/dbname[?key=value&key=value...]``. If dbname is
-present, the host, port, and dbname tokens are converted to a TNS name using
+When connecting with ``dbname`` present, the host, port, and dbname tokens are
+converted to a TNS name using
the cx_oracle :func:`makedsn()` function. Otherwise, the host token is taken
directly as a TNS name.
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the Oracle database via the zxjdbc JDBC connector.
-
-JDBC Driver
------------
-
-The official Oracle JDBC driver is at
-http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html.
+"""
+.. dialect:: oracle+zxjdbc
+ :name: zxJDBC for Jython
+ :dbapi: zxjdbc
+ :connectstring: oracle+zxjdbc://user:pass@host/dbname
+ :driverurl: http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html.
"""
import decimal
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the PostgreSQL database.
-
-DBAPI Support
--------------
-
-The following dialect/driver options are available:
-
-* :ref:`psycopg2`
-
-* :ref:`pg8000`
-
-* :ref:`pypostgresql`
+"""
+.. dialect:: postgresql
+ :name: PostgreSQL
-* :ref:`zxjdbc`
Sequences/SERIAL
----------------
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the PostgreSQL database via the pg8000 driver.
-
-DBAPI
-------
-
- http://pybrary.net/pg8000/
-
-Connecting
-----------
-
-Connect string format::
-
- postgresql+pg8000://user:password@host:port/dbname[?key=value&key=value...]
+"""
+.. dialect:: postgresql+pg8000
+ :name: pg8000
+ :dbapi: pg8000
+ :connectstring: postgresql+pg8000://user:password@host:port/dbname[?key=value&key=value...]
+ :url: http://pybrary.net/pg8000/
Unicode
-------
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the PostgreSQL database via the psycopg2 driver.
-
-DBAPI
-------
-
-The psycopg2 driver is available at http://pypi.python.org/pypi/psycopg2/ .
-The dialect has several behaviors which are specifically tailored towards compatibility
-with this module.
-
-Note that psycopg1 is **not** supported.
-
-Connecting
-----------
-
-Connect string format::
-
- postgresql+psycopg2://user:password@host:port/dbname[?key=value&key=value...]
+"""
+.. dialect:: postgresql+psycopg2
+ :name: psycopg2
+ :dbapi: psycopg2
+ :connectstring: postgresql+psycopg2://user:password@host:port/dbname[?key=value&key=value...]
+ :url: http://pypi.python.org/pypi/psycopg2/
psycopg2 Connect Arguments
-----------------------------------
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the PostgreSQL database via py-postgresql.
-
-DBAPI
------
-
- http://python.projects.pgfoundry.org/
-
-Connecting
-----------
-
-Connect string format::
-
- postgresql+pypostgresql://user:password@host:port/dbname[?key=value&key=value...]
+"""
+.. dialect:: postgresql+pypostgresql
+ :name: py-postgresql
+ :dbapi: pypostgresql
+ :connectstring: postgresql+pypostgresql://user:password@host:port/dbname[?key=value&key=value...]
+ :url: http://python.projects.pgfoundry.org/
"""
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the PostgreSQL database via the zxjdbc JDBC connector.
-
-DBAPI
------------
-
-The official Postgresql JDBC driver is at http://jdbc.postgresql.org/.
-
-Connecting
-----------
-
-Connect string format::
-
- postgresql+zxjdbc://scott:tiger@localhost/db
+"""
+.. dialect:: postgresql+zxjdbc
+ :name: zxJDBC for Jython
+ :dbapi: zxjdbc
+ :connectstring: postgresql+zxjdbc://scott:tiger@localhost/db
+ :driverurl: http://jdbc.postgresql.org/
"""
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the SQLite database.
+"""
+.. dialect:: sqlite
+ :name: SQLite
+
Date and Time Types
-------------------
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for the SQLite database via pysqlite.
+"""
+.. dialect:: sqlite+pysqlite
+ :name: pysqlite
+ :dbapi: sqlite3
+ :connectstring: sqlite+pysqlite:///file_path
+ :url: http://docs.python.org/library/sqlite3.html
-Note that pysqlite is the same driver as the ``sqlite3``
-module included with the Python distribution.
+ Note that ``pysqlite`` is the same driver as the ``sqlite3``
+ module included with the Python distribution.
Driver
------
from sqlite3 import dbapi2 as sqlite
e = create_engine('sqlite+pysqlite:///file.db', module=sqlite)
-Full documentation on pysqlite is available at:
-`<http://www.initd.org/pub/software/pysqlite/doc/usage-guide.html>`_
Connect Strings
---------------
The file specification for the SQLite database is taken as the "database" portion of
-the URL. Note that the format of a url is::
+the URL. Note that the format of a SQLAlchemy url is::
driver://user:pass@host/database
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""Support for Sybase Adaptive Server Enterprise (ASE).
+"""
+
+.. dialect:: sybase
+ :name: Sybase
.. note::
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-
"""
-Support for Sybase via mxodbc.
-This dialect is a stub only and is likely non functional at this time.
+.. dialect:: sybase+mxodbc
+ :name: mxODBC
+ :dbapi: mxodbc
+ :connectstring: sybase+mxodbc://<username>:<password>@<dsnname>
+ :url: http://www.egenix.com/
+
+.. note::
+
+ This dialect is a stub only and is likely non functional at this time.
"""
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
-Support for Sybase via pyodbc.
+.. dialect:: sybase+pyodbc
+ :name: PyODBC
+ :dbapi: pyodbc
+ :connectstring: sybase+pyodbc://<username>:<password>@<dsnname>[/<database>]
+ :url: http://pypi.python.org/pypi/pyodbc/
-http://pypi.python.org/pypi/pyodbc/
-
-Connect strings are of the form::
-
- sybase+pyodbc://<username>:<password>@<dsn>/
- sybase+pyodbc://<username>:<password>@<host>/<database>
Unicode Support
---------------
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
-Support for Sybase via the python-sybase driver.
-
-http://python-sybase.sourceforge.net/
-
-Connect strings are of the form::
-
- sybase+pysybase://<username>:<password>@<dsn>/[database name]
+.. dialect:: sybase+pysybase
+ :name: Python-Sybase
+ :dbapi: Sybase
+ :connectstring: sybase+pysybase://<username>:<password>@<dsn>/[database name]
+ :url: http://python-sybase.sourceforge.net/
Unicode Support
---------------
return exclusions.open()
@property
- def empty_strings(self):
- """target database can persist/return an empty string."""
+ def empty_strings_varchar(self):
+ """target database can persist/return an empty string with a varchar."""
+
+ return exclusions.open()
+
+ @property
+ def empty_strings_text(self):
+ """target database can persist/return an empty string with an
+ unbounded text."""
return exclusions.open()
assert isinstance(row[0], unicode)
- @requirements.empty_strings
- def test_empty_strings(self):
+ def _test_empty_strings(self):
unicode_table = self.tables.unicode_table
config.db.execute(
datatype = Unicode(255)
+ @requirements.empty_strings_varchar
+ def test_empty_strings(self):
+ self._test_empty_strings()
+
class UnicodeTextTest(_UnicodeFixture, fixtures.TablesTest):
__requires__ = 'unicode_data', 'text_type'
datatype = UnicodeText()
+ @requirements.empty_strings_text
+ def test_empty_strings(self):
+ self._test_empty_strings()
+
__all__ = ('UnicodeVarcharTest', 'UnicodeTextTest')
\ No newline at end of file
return skip_if("drizzle", "no VIEW support")
@property
- def empty_strings(self):
- """target database can persist/return an empty string."""
+ def empty_strings_varchar(self):
+ """target database can persist/return an empty string with a varchar."""
+
+ return fails_if("oracle", 'oracle converts empty '
+ 'strings to a blank space')
+
+ @property
+ def empty_strings_text(self):
+ """target database can persist/return an empty string with an
+ unbounded text."""
return fails_if("oracle", 'oracle converts empty '
'strings to a blank space')