I’m working on packing up our current meltano prot...
# troubleshooting
n
I’m working on packing up our current meltano prototype to move to a more production ready state based on the docs here. We’ll be using the containerized version of things and I need to set up a more persistant metadata store than SQL lite. Based on that, I had a few questions: • Does the database need to be postgres? Could I use mysql instead? (initial experimentation seems to suggest I can, but not sure if there are pitfalls I haven’t discovered yet) • What’s the best way to initialize the new metadata store? I could create CREATE/INSERT statements to replicate the contents of the SQLite db in a new place, but I wondered if there might be a one-liner that could do that more efficiently?
j
I agree that this is far from straight-forward 😞
n
“production” rarely is 🙂
Another question: If one is trying to use meltano’s scheduler (rather than setting up everything in airflow directly), is it possible to use the
--select
flag for a scheduled job in the same way one can from the command line? https://meltano.com/docs/command-line-interface.html#schedule says that I can do that when I’m running manual-one-offs, but what if I want to schedule certain tables in a tap to be updated hourly and others to be updated nightly, for example?
a
Does the database need to be postgres? Could I use mysql instead?
I have not using MySQL so I’m honestly not 100% sure. I think all operations are backed by SQLAlchemy, so in theory this could work. I just don’t know if there are any compatibility issues which would become an issue.
What’s the best way to initialize the new metadata store?
Is there a reason not to allow Meltano to auto-create the database on demand? We actually have some users who run meltano without a backend. After each run, they export state explicitly so the database can be spun down, and then they send in the state file again on the next invocation.
is it possible to use the 
--select
 flag for a scheduled job in the same way one can from the command line?
When scheduling with Airflow (the default scheduler), I believe this would just require modifying the respective jobs in the Airflow dag. Hope this helps, @nick_hamlin!
n
Thanks @aaronsteers! That was my guess on mysql as well, and I’ve figured out how to get meltano to connect via SQLalchemy just fine (Tip for future searchers: replace
postgres
with
mysql-pymysql
in the connection string - specifying a modern mysql driver is important, otherwise it’ll default to MySQLdb, which doesn’t play nice with python 3). My preference would also be to let Meltano auto-create the database, which is what I assumed it would do when I updated
$DATABASE_URI
to point to the new database. It didn’t seem to do anything though, which is why I wasn’t sure if I needed some kind of init command to get it to kick things off again. Couldn’t find anything in the docs, but I suspect this probably exists
I think you’re also right about modifying the airflow dag directly to allow for more expressive scheduled jobs, and I played around with that a bit but got stuck in trying to pass new variables in `meltano.yml`through to support that. I found the places in the meltano code where I could theoretically make changes to allow that, but I’d like to avoid forking for the moment if I can 🙂 . In the meantime, I have another idea for how to use simpler jobs via the meltano UI while I’m getting started, and I’ll write fancier ones down the road if it turns out I actually need them
a
My preference would also be to let Meltano auto-create the database, which is what I assumed it would do when I updated  
$DATABASE_URI
  to point to the new database. It didn’t seem to do anything though, which is why I wasn’t sure if I needed some kind of init command to get it to kick things off again. Couldn’t find anything in the docs, but I suspect this probably exists
@nick_hamlin - Totally random, but this might be related to what you are looking for: https://meltano.slack.com/archives/C01TCRBBJD7/p1617646393244900?thread_ts=1617639532.243200&cid=C01TCRBBJD7
n
huh, interesting! that one is new to me as well
a
If you find that the database or schema is not initializing in a way you expect, you could try this
meltano schema create <SCHEMA> <ROLES>
command as a start.
n
thanks, will do!