MSSQL Driver

Skip to first unread message

Thijs Maenhout

Mar 30, 2021, 11:07:02 AM3/30/21
to peewee-orm

I'm trying to implement an MSSQL driver through ZXJDBC in jython 2.7.2.  in Pewee 3.0

I'm already able to create a connection and check existance of tables, but I'm somehow stuck on how to implement a custom SchemaManager for this specific SQL dialect.

The _create_table in peewee.SchemaManager is not compliant to the MSSQL SQL dialect so I neew to override this.  What is the best way to do this?  Should I register this custom SchemaManager in the Custom Database class ?

Thanks for any insights, I really appreciate this.

Congratz with your wonderfull library, I love it.

Charles Leifer

Mar 30, 2021, 11:34:57 AM3/30/21
I'm not too sure how to advise as I'm not up on the differences. Any differences in the specification of column data-types would be handled elsewhere (DatabaseClass.field_types overrides). If the create table query structure is very different then, yeah, you probably need a custom SchemaManager.

Sorry not to be of much help, I have never used MSSQL before.

You received this message because you are subscribed to the Google Groups "peewee-orm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Thijs Maenhout

Mar 31, 2021, 1:57:23 AM3/31/21
to peewee-orm
Hi Charles,

Thank you for your remarks.

One more question though, how should I  register my custom SchemaManager ?  Should I make a custom Model?  Or is it possible to register this in my custom DatabaseClass?

Kind regards,

Op dinsdag 30 maart 2021 om 17:34:57 UTC+2 schreef Charles:

Charles Leifer

Mar 31, 2021, 8:46:07 AM3/31/21
You can create a base model class and inherit from it:

class MyBaseModel(Model):
    class Meta:
        schema_manager_class = MSSQLSchemaManager

Reply all
Reply to author
0 new messages