Hi,

I need to create some named indexes, i.e. something other than the
default "ix_mytable_coln":

One such schema is:

CREATE_ASSERTED_STATEMENTS_TABLE = '''
CREATE TABLE %s_asserted_statements (
    subject       text not NULL,
    predicate     text not NULL,
    object        text not NULL,
    context       text not NULL,
    termComb      tinyint unsigned not NULL)'''

One such set of indices: (basically a "CREATE INDEX %s on %s (%s)"
mapped against the following):

("%s_asserted_statements",
 [("%s_A_termComb_index",('termComb',)),
  ("%s_A_s_index",('subject',)),
  ("%s_A_p_index",('predicate',)),
  ("%s_A_o_index",('object',)),
  ("%s_A_c_index",('context',))]),

SQLA docs [1] state that this is achieved by using Index object
declarations constructed externally from the table object, using the
interned columns, not strings.

AIUI, I can't just drop SQL Index declarations such as:

Index('%s_A_termComb_index' % tgtstr, <getcolfrommapper>)

straight into my elixir model and expect them to work because the
mapper is constructed at a later stage.

Any ideas on how to proceed?

[1] http://www.sqlalchemy.org/docs/metadata.html#indexes

Cheers

Graham

-- 
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en.

Reply via email to