UNPKG

simplifield-sql

Version:

A simplifield sql package that makes your work more easier, simpler and smarter!.

47 lines (46 loc) 1.02 kB
import { Row } from "../../utils/types"; /** * @description This function is used to create a new table * @returns Promise * @example * await db.createTable("users", [ * { * name: "id", * dataType: "INT", * primaryKey: true, * autoIncrement: true, * }, * { * name: "username", * dataType: "VARCHAR", * dataLength: 255, * characterSet: "utf8mb4", * collation: "utf8mb4_general_ci", * allowNull: false, * unique: true, * }, * ]); * // output: { * // table: "users", * // rows: [ * // { * // name: "id", * // dataType: "INT", * // primaryKey: true, * // autoIncrement: true, * // }, * // { * // name: "username", * // dataType: "VARCHAR(255)", * // characterSet: "utf8mb4", * // collation: "utf8mb4_general_ci", * // allowNull: false, * // unique: true, * // } * // ] * } */ export default function (table: string, rows: Row[]): Promise<{ table: string; rows: Row[]; }>;