Code Monkey home page Code Monkey logo

mypower's Introduction

MyPower

A set of database common operations functions for MySQL. In particular, you can operate the database on the specific server, the operations include create, delete, drop, use, backup, restore, clone.

Install

npm i mypower --save

Usage

Initialize

Initialize MyPower first:

// Your mysql configuration
const config = {
	database: 'sys',
	username: 'root',
	password: 'playboy',
	host: '127.0.0.1',
	port: 3306,
};

const my = require('mypower');
my.init(config);

Click below links to see usages (from test cases).

The * indicates that databases on other servers can be operated remotely.

  • my.connectServer() *
  • my.isServerOnline() *
  • my.switchToServer() *
  • my.backupAllDatabases() *
  • my.backupDatabase() *
  • my.cloneDatabase() *
  • my.cloneDatabaseStructure() *
  • my.renameDatabase()
  • my.restoreAllDatabases() *
  • my.restoreDatabase() *
  • my.createDatabase() *
  • my.deleteDatabase() *
  • my.dropDatabase() *
  • my.getDatabasesName() *
  • my.getSelectedDatabase() *
  • my.isDatabaseExists() *
  • my.showDatabases() *
  • my.useDatabase() *
  • my.addField()
  • my.addFields()
  • my.changeField()
  • my.changeFieldName()
  • my.changeFieldType()
  • my.changeFields()
  • my.convertFieldTypeDefToStr()
  • my.deleteField()
  • my.deleteFields()
  • my.fieldTypes
  • my.getAutoIdName()
  • my.getFieldNames()
  • my.getFieldNamesWithoutAutoId()
  • my.getFieldType()
  • my.getFieldTypeStr()
  • my.getFieldsInfo()
  • my.isFieldExists()
  • my.updateField()
  • my.updateFields()
  • my.addPrimaryKey()
  • my.addPrimaryKeys()
  • my.getPrimaryKey()
  • my.getPrimaryKeys()
  • my.getMaxFieldValue()
  • my.getMaxId()
  • my.getMaxPrimaryKeyValue()
  • my.getMaxRecord()
  • my.getMinFieldValue()
  • my.getMinId()
  • my.getMinRecord()
  • my.isRecordExists()
  • my.recordsCount()
  • my.getSystemVariable()
  • my.getSystemVariables()
  • my.getVersion()
  • my.getWarningCount()
  • my.isSuccessful()
  • my.cloneTable()
  • my.cloneTableStructure()
  • my.copyTableData()
  • my.createTable()
  • my.deleteTable()
  • my.deleteTables()
  • my.descTable()
  • my.dropTable()
  • my.dropTables()
  • my.isEmptyTable()
  • my.isTableExists()
  • my.moveTable()
  • my.renameTable()
  • my.showTables()
  • my.truncateTable()

Query

Crud

  • my.next()
  • my.previous()

Paging

Test

git clone https://github.com/hiowenluke/mypower
cd mypower
npm install
npm test

License

MIT

Copyright (c) 2019, Owen Luke

mypower's People

Contributors

hiowenluke avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.