Skip to content

Convert create table statement to typescript interface

License

Notifications You must be signed in to change notification settings

zhenhuaa/sql2ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL to TS

Convert create table statement to typescript interface

Example

Input

CREATE TABLE `profile` (
  `roleId` bigint(20) NOT NULL COMMENT 'playerId',
  `location` varchar(50) DEFAULT NULL COMMENT 'country-province-city',
  `signature` varchar(100) DEFAULT NULL COMMENT 'signature text',
  `avatar` varchar(255) DEFAULT NULL COMMENT 'user avatar url',
  PRIMARY KEY (`RoleId`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='user profile';

Output:

/** user profile */
interface profile {
  /** playerId */
  roleId: number
  /** country-province-city */
  location: string
  /** signature text */
  signature: string
  /** user avatar url */
  avatar: string
}

About

Convert create table statement to typescript interface

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published