### Table of Contents - [setupTables][1] - [Parameters][2] - [dropTables][3] - [Parameters][4] - [Job][5] - [Parameters][6] - [Properties][7] - [done][8] - [remove][9] - [Queue][10] - [Parameters][11] - [add][12] - [Parameters][13] - [getJob][14] - [Parameters][15] - [process][16] - [Parameters][17] ## setupTables Sets up tables in a PostgreSQL database. ### Parameters - `knex` Knex instance to use to setup tables. - `options` Specifies table names and other options ## dropTables Drops tables from PostgreSQL database. ### Parameters - `knex` Knex instance to use to drop tables - `options` Specifies table names ## Job Represents a single or recurring job by ID. ### Parameters - `id` **[number][18]** ID number of job - `knex` **Knex** Knex instance to use - `tableOptions` **TableOptions** Table options including names - `pollMs` **[number][18]** Poll interval - `tx` **Knex.Transaction** Transaction if applicable (inside processing function) ### Properties - `id` **[number][18]** Job ID number - `data` **[object][19]** Job data ### done Waits for a job to complete (only applicable to non-recurring jobs) ### remove Removes job from queue ## Queue This represents a single queue. ### Parameters - `name` - `knex` - `options` **TableOptions** Job options - `data` **[object][19]** Job data ### add Adds a single or recurring job to the queue #### Parameters - `data` **[object][19]** Job data to be passed to the processing function - `options` **JobOptions** Job options for configuring repeat and output handling ### getJob Gets a Job object from the queue. #### Parameters - `id` **[number][18]** Job ID number ### process Process runs the queue and processes jobs. #### Parameters - `cb` **[Function][20]** Callback to handle a job. Return value should be job result. [1]: #setuptables [2]: #parameters [3]: #droptables [4]: #parameters-1 [5]: #job [6]: #parameters-2 [7]: #properties [8]: #done [9]: #remove [10]: #queue [11]: #parameters-3 [12]: #add [13]: #parameters-4 [14]: #getjob [15]: #parameters-5 [16]: #process [17]: #parameters-6 [18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number [19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object [20]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function