furkifor/sql_dumper

Laravel eloquent mantığıyla orm işlemlerinde sql çıktısı alma projesi

v0.2 2024-08-28 07:33 UTC

This package is auto-updated.

Last update: 2024-10-28 07:55:58 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

composer require furkifor/sql_dumper

Kullanımı

$sql_dumper = new Furkifor\SqlDumper("TABLE_NAME");
echo $sql_dumper->select('*')->get();
// select * from TABLE_NAME 

Migrate Kullanımı

$table = new MigrateClass("mysql");
$table->name("users")
    ->string('username',255)->unique()->notnull()
    ->string('email',255)->unique()->notnull()
    ->string('password',255)->notnull()
    ->datetime('created_at')->default("CURRENT_TIMESTAMP")
    ->int('role_id')->notnull()->foreignKey('roles','id')->check("role_id>0")
    ->createTable();
/*
CREATE TABLE users (
  id INT(11) AUTO_INCREMENT PRIMARY KEY NOT NULL,
  username VARCHAR(255) NOT NULL UNIQUE,
  email VARCHAR(255) NOT NULL UNIQUE,
  password VARCHAR(255) NOT NULL,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  role_id INT NOT NULL,
  FOREIGN KEY (role_id) REFERENCES roles(id),
  CHECK (role_id > 0)
)
*/

License

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