In SQL mode, we could select the product type such posgres, mysql, oracle etc, and the default one is ANSI, how to set the default type as postgresql after startup emacs? What needs to be put in .emacs?
SQL mode has sql-set-product
function which is used to set the product.
C-h f sql-set-product RET
lists the details of the function.
sql-set-product is an interactive compiled Lisp function. (sql-set-product PRODUCT) Set `sql-product' to PRODUCT and enable appropriate highlighting.
So, you can add
(sql-set-product 'postgres)
to your .emacs file to make it as default.
At any point of time, if you want to change it mysql or something else, you can use
M-x sql-set-product RET mysql RET
Alternatively, as shown in @teaforthecat's answer, the product can be set from a comment on the first line
-- -*- mode: sql; sql-product: mysql; -*-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With