Sergei Podlipaev Sergei Podlipaev - 12 days ago 6
Scala Question

How to run sql scripts during sbt build

I'm building my scala application with sbt. How can I run .sql script file during the build?

It is possible to run scripts with ant like this

<target name = "createTables">
<sql
classpathref="classpath"
driver="${database_driver_class_name}"
url="${database_url}"
userid="${user}"
password="${password}"
src="createTables.sql"/>




Can I do the same with sbt?

Answer

You can do it with an sbt plugin such as FlyWay (https://flywaydb.org/documentation/sbt/)

Comments