Does someone knows is there a method of a qgis class to store styles to a postgis stored style. I know I can save a qlm file but I'm a searching for an alternative to this.

As an alternative I try to store vector styles in a spatialite database using pyspatialite. First a create the tables to store it SELECT CreateStylingTables();. I'm fine from taht point but I'm struggling with the sql function select RegisterVectorStyledLayer();. I set the name of the table and it geometry column, as it said in the documentation, but I have a message error that says the function doesn't exists.

I would really want to do as qgis does from gui (layer properties/save style in database). So I'm searching for a piece of code to do this.

1 Answer 1


According to the documentation for SpatiaLite SQL functions, the function should be SE_RegisterVectorStyledLayer (and not RegisterVectorStyledLayer as stated above)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.