Skip to content

A developer-friendly tool for transfering sql statement to go struct.

Notifications You must be signed in to change notification settings

ccc469/sql2struct

This branch is 3 commits ahead of idoubi/sql2struct:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

30ba1b2 · Mar 25, 2023

History

21 Commits
Mar 25, 2023
Jun 25, 2022
Jun 25, 2022
Oct 6, 2022
Jun 25, 2022
Jun 25, 2022
Jun 30, 2022
Jun 30, 2022
Jun 30, 2022
Feb 5, 2023
Feb 5, 2023
Jun 30, 2022
Jun 25, 2022
Jun 22, 2022
Jun 30, 2022

Repository files navigation

sql2struct

SQL2Struct is a developer-friendly tool used for transfering sql statement to go struct.

中文说明

use sql2struct online

click to visit the sql2struct online website

use sql2struct as chrome extension

  1. install from source
git clone https://github.com/idoubi/sql2struct.git
cd sql2struct
pnpm install
  1. build chrome extension
pnpm build:chrome
  1. install chrome extension

open chrome://extensions/

load extension from sql2struct project dir dist/chrome

use sql2struct locally

  1. install from source
git clone https://github.com/idoubi/sql2struct.git
cd sql2struct
pnpm install
  1. preview
pnpm dev
  1. build
pnpm build

# or

pnpm build:web

how to use

  1. execute show create table xxx\G; in your database client.

20220626221324

  1. paste sql statement in the left editor.

20220626222145

and you'll see the go struct code in the right editor transfered from the sql statement you pasted.

  1. change the transfer options.

by default, only json tags will be used in transfered go struct code. you can click other checkboxes to add more tags. =[]

20220626222618

and you can click "options" button to modify other transfer options.

fields in "special identifiers" will be uppercased when transfered to go struct fields.

20220626222854

"field maps" defines the map rules between sql field type and go struct field type.

20220626222912

something else

stars and issues are all be appreciated.

you can contact me by email to [email protected].

About

A developer-friendly tool for transfering sql statement to go struct.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 86.1%
  • JavaScript 4.9%
  • Less 4.9%
  • HTML 2.2%
  • CSS 1.9%