ravener / miyako

A multipurpose Discord Bot
MIT License
156 stars 55 forks source link

Question #20

Closed buttermiilk closed 4 years ago

buttermiilk commented 4 years ago

So um, are there anyway to change from PostgreSQL to something else? I feel like PostgreSQL isn't an option for me, and I would really appreciate it if there is a method for that.

Oh, if you can, may I ask for a list of stuff that I need to rewrite? Thanks.

ravener commented 4 years ago

There isn't a direct way to change it but nothing stops you from changing the code. The main database driver is in structures/Settings.js then the connection logic is in structures/MiyakoClient.js other than that if the settings class is properly implemented the rest of the code should work as it does not directly touch the database. Let me know which database you are using. I've let my friend use the base framework of my bot except he wanted to use mongodb so I do have a mongodb implementation ready if you are interested

buttermiilk commented 4 years ago

Ah, yes. May I take a look at it?

ravener commented 4 years ago

Here you go: https://hastebin.com/foqelubaqu.js

Add that to structures/Settings.js

Then edit the client to connect a mongodb database and define it on client.db

Few major notes:

buttermiilk commented 4 years ago

I spent a few hours to get this work, and it did, but I think PostgreSQL does the job better than MongoDB a little bit. Thanks for the help!