Sergei Podlipaev Sergei Podlipaev - 1 year ago 109
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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download