mysql-go
v2.2.5
Published
Framework Feito para facilitar a vida no mysql2
Downloads
9
Maintainers
Readme
COMANDOS
const { Database } = require('mysql-go');
const banco = new Database();
banco.createDatabase('NOME DO BANCO');
//Cria um banco de dados!
//Ex: banco.createDatabase('banco');
banco.createTable('NOME DO BANCO', 'NOME DA TABELA', 'SQL');
//Cria uma tabela!
//Ex: banco.createTable('banco', 'usuarios', 'nome varchar(255)');
banco.insert('NOME DO BANCO', 'NOME DA TABELA', 'PARAMETRO', 'VALOR');
//Coloca dados na tabela!
//Ex: banco.insert('banco', 'usuarios', 'nome', '"cleysson"');
banco.addRow('NOME DO BANCO', 'NOME DA TABELA', 'SQL')
//Adiciona uma linha na tabela!
//Ex: banco.addRow('banco', 'usuarios', 'idade int')
banco.update('NOME DO BANCO', 'NOME DA TABELA', 'OQUE QUER ALTERAR', 'CONDINÇÃO')
//Deleta um banco!
//Ex: banco.update('banco', 'usuarios', 'nome = "jose"', 'id = 1')
banco.select('NOME DO BANCO', 'NOME DA TABELA', 'LINHA DA TABELA', 'CONDICIONAL').then( ([rows,fields]) => {
//FUNÇÃO
})
//Procura um valor expecifo na tabela!
//Ex: banco.select('banco', 'usuarios', 'nome', 'nome = "cleysson"').then( ([rows,fields]) => {
// console.log(rows);
//})
banco.selectAll('NOME DO BANCO', 'NOME DA TABELA').then( ([rows,fields]) => {
//FUNÇÃO
});
//Procura todos os lavores da tabela!
//Ex: banco.selectAll('banco', 'usuarios').then( ([rows,fields]) => {
// console.log(rows);
//});
banco.deleteRow('NOME DO BANCO', 'NOME DA TABELA', 'CHAVE DA CONDICIONAL', 'CONDICIONAL');
//Deleta uma linha da tabela!
//Ex: banco.deleteRow('banco', 'usuarios', 'nome', 'cleysson');
banco.deleteTable('NOME DO BANCO', 'NOME DA TABELA');
//Deleta uma tabela do banco!
//Ex: banco.deleteTable('banco', 'usuarios');
banco.deleteDatabase('NOME DO BANCO')
//Deleta um banco!
//Ex: banco.deleteTable('banco');