Leo Sql Challenge

22 views
Skip to first unread message

k-hen

unread,
Sep 22, 2020, 11:05:50 AM9/22/20
to leo-editor
Hi All,
Looking for ideas for best practice - for another unusual situation.
As mentioned previously, I'm using the Alembic library to do SQL schema migrations.

So ...
1: I have an @clean my_migration.py file directive.
2: I have python functions that return  ....
3:  sql/ddl strings to execute.
and ... I'd like to use Leo to help for this, with python highlighted as python and sql as sql (indented).
How do I nest the @language directives for python & sql wrapped in a sql string?

so ...
my_migration.py

def get_table_create_sql():
    sql = """
      create table [x].[y] (
       )
    """
    return sql

Any pointers or advice would be appreciated.

Thanks,
Kevin


 



Reply all
Reply to author
Forward
0 new messages