oxen-queue icon indicating copy to clipboard operation
oxen-queue copied to clipboard

Auto check and create job table

Open kritzware opened this issue 7 years ago • 2 comments

Instead of making the user call the method createTable(), the library could check if the table exists once connected and then call this function internally if not.

await ox.createTable()

kritzware avatar Sep 05 '18 16:09 kritzware

That's interesting... is there much of a cost to calling

CREATE TABLE IF NOT EXISTS oxen_queue

for every instance of Oxen?

avermeil avatar Sep 06 '18 09:09 avermeil

No, I don't see anything wrong with create table if not exist, rather this is a safe and good programming. About auto checking, Yes, it will be a good thing to do that.

Also, it would be nice if, we can pass a connection to the new Oxen() constructor. Most of the time, projects that would be using this library would already have a connection setup to the MySQL DB, so it's will be quite nice and effective if the same connection could be reused rather than creating a new connection to the DB.

gaurav8298 avatar Mar 06 '23 12:03 gaurav8298