定制 codewdev/tablegenerator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

codewdev/tablegenerator

Composer 安装命令:

composer require codewdev/tablegenerator

包简介

Biblioteca de criação de tabelas para projetos em php

README 文档

README

Maintainer Source Code PHP from Packagist Latest Version Software License Build Quality Score Total Downloads

The table generator is a component for creating tables for your database that uses PDO to add, delete and edit tables using a flat file in php.

O table generator é um componente para criação de tabelas para seu banco de dados que usa PDO para incluir, deletar e editar tabelas usando m arquivo simples em php.

Highlights

  • Easy to set up (Fácil de configurar)
  • Create tables fast and easy (Crie tabelas rápido e fácil)
  • Composer ready (Pronto para o composer)

Installation

Table Generator is available via Composer:

"codewdev/tablegenerator": "1.0.*"

or run

composer require codewdev/tablegenerator

Documentation

For more details on how to use Table Generator, see the example folder with details in the component directory

Para mais detalhes sobre como usar o Table Generator, veja a pasta de exemplo com detalhes no diretório do componente

connection

To begin using the Table Generator, you need to connect to the database (MariaDB / MySql). For more connections PDO connections manual on PHP.net

Para começar a usar o Table Generator precisamos de uma conexão com o seu banco de dados. Para ver as conexões possíveis acesse o manual de conexões do PDO em PHP.net

define("TABLE_GEN_CONF", [
    "driver" => "mysql",
    "host" => "localhost",
    "port" => "3306",
    "dbname" => "nome_db",
    "username" => "root",
    "passwd" => "",
    "options" => [
        PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8",
        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
        PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ,
        PDO::ATTR_CASE => PDO::CASE_NATURAL
    ]
]);

your model

<?php

use CodeWdev\TableGenerator\TableGenerator;

require __DIR__ . "/../vendor/autoload.php";


//creating table
$user_data = new TableGenerator("users", [
    "first_name" => "VARCHAR(10) NOT NULL",
    "last_name" => "VARCHAR(255) NOT NULL",
    "email" => "VARCHAR(255) UNIQUE NOT NULL",
    "password" => "VARCHAR(255) NOT NULL DEFAULT 0"
]);


//command to create the table
$user_data->create();


//adding columns to the table
$user_data->addColumn([
    "document" => "VARCHAR(10)",
    "company" => "VARCHAR(50) NOT NULL"
]);


//
//deleting a column
$user_data->dropColumn("company");


//deleting a table
$user_data->drop();

Contributing

Please see CONTRIBUTING for details.

Support

If you discover any issues related to the component or would like to make a contribution, please feel free to get in touch.

Se você descobrir algum problema relacionado ao componente ou quiser dar uma contribuição, fique a vontade para entrar em contato.

Thank you

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-08-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固