Skip to content

Database support #3

@robballou

Description

@robballou

The original rotatelib supports rotating database tables that have date-based names. This would need a means to let users pass DB credentials and interface with a database via JS. Perhaps something like this:

var rotatelib = require('js-rotatelib');

var params = {
  before: "-7 days",
  database: {
    type: 'mysql',
    user: 'root',
    password: 'secret',
    name: 'example'
  }
};

rotatelib
  .list(params)
  .then(function(items) {
    rotatelib.removeItems(items, params)
      .then(function() {
        var plural = items.length !== 1 ? 's' : '';
        console.log('Removed ' + items.length + ' table' + plural);
      });
  });

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions