Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to switch database backends in Genie.jl if you already created an App?

Tags:

julia

genie.jl

I am following this tutorial: https://genieframework.com/docs/tutorials/Developing-MVC-Web-Apps.html#gettingstarted-creatingtheapp where I created my MVC app and selected a MySQL backend. However, I am having issues with MySQL so I want to switch the app to SQLite as the tutorial uses. Is there any way I can switch the app to use that or would I have to manually re-create a new project? If I can switch it, what files need to be manually modified or is there a function that can help me?

like image 320
logankilpatrick Avatar asked Oct 28 '25 04:10

logankilpatrick


1 Answers

You switch it manually, it's quite easy:

1/ add support for SQLite via SearchLightSQLite:

pkg> add SearchLightSQLite

2/ edit db/connection.yml and set adapter to SQLite and database to the path where you want to store the DB, ex:

dev:
  adapter: SQLite
  database: db/dev.sqlite

3/ Restart the app

like image 159
essenciary Avatar answered Oct 31 '25 02:10

essenciary



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!