☄ The golang convenient converter supports Database to Struct, SQL to Struct, and JSON to Struct.

Gormat - Cross platform gopher tool

The golang convenient converter supports Database to Struct, SQL to Struct, and JSON to Struct.

Go Go Report Card codecov shields 中文说明

image

Features

  • Database to Struct
    • Data engine
      • Mysql
    • Auto save file
    • Tags
      • Gorm
      • Xrom
      • JSON
    • Exclude list
    • Data mapping
    • Custom transformation
  • SQL to Struct
  • JSON to Struct

About

In golang development, there are times when you need to tap the structure manually and store it manually.Although Gorm has the ability to migrate automatically, it does not form database fields effectively and ideally.There are also many open source examples on the web, but there are no user-friendly and easy-to-manage tools, so I started this project with the goal of more efficient development, conversion and ready-to-use.

This project borrows a lot of code from open source conversion libraries and makes some adjustments in conjunction with orm.There are many problems encountered in the development, and Fyne is a GUI development framework with many pits, which should not be further discussed.Whether it is a database to Struct or a SQL to Struct statement, there are still some errors, so the conversion results are only for reference, please adjust the use of the actual project.

Prerequisites

golang 1.11+

Installation

No additional environment is required for installation and use, move to releases to download.

Different platforms need to install additional development environments.

Linux and BSD:

Ubuntu / Debian: sudo apt-get install golang gcc libgl1-mesa-dev xorg-dev
Fedora: sudo dnf install golang gcc libXcursor-devel libXrandr-devel mesa-libGL-devel libXi-devel libXinerama-devel
Solus: sudo eopkg it -c system.devel golang mesalib-devel libxrandr-devel libxcursor-devel libxi-devel libxinerama-devel
Arch Linux: sudo pacman -S go xorg-server-devel

Windows:

Gcc

Usage example

SET CGO_ENABLED=1
SET CC=x86_64-w64-mingw32-gcc
SET GOOS=windows
SET GOARCH=amd64
go build -o gormat.exe -ldflags="-H windowsgui"

In this project, Fyne is used for development. For more steps of packaging and compiling, please refer to https://fyne.io/develop/distribution.html

Thanks

github.com/hsyan2008/gom
github.com/fatih/structtag
github.com/yujiahaol68/sql2struct
github.com/bashtian/jsonutils

License

For the MIT agreement of this project, please click LICENSE for more details.

Similar Resources

A course to build the SQL layer of a distributed database.

TinySQL TinySQL is a course designed to teach you how to implement a distributed relational database in Go. TinySQL is also the name of the simplifed

Jan 8, 2023

A tiny Golang JSON database

Scribble A tiny JSON database in Golang Installation Install using go get github.com/nanobox-io/golang-scribble. Usage // a new scribble driver, provi

Dec 31, 2022

This is a simple graph database in SQLite, inspired by "SQLite as a document database".

About This is a simple graph database in SQLite, inspired by "SQLite as a document database". Structure The schema consists of just two structures: No

Jan 3, 2023

Hard Disk Database based on a former database

Hard Disk Database based on a former database

Nov 1, 2021

Membin is an in-memory database that can be stored on disk. Data model smiliar to key-value but values store as JSON byte array.

Membin Docs | Contributing | License What is Membin? The Membin database system is in-memory database smiliar to key-value databases, target to effici

Jun 3, 2021

A simple, fast, embeddable, persistent key/value store written in pure Go. It supports fully serializable transactions and many data structures such as list, set, sorted set.

NutsDB English | 简体中文 NutsDB is a simple, fast, embeddable and persistent key/value store written in pure Go. It supports fully serializable transacti

Jan 1, 2023

Nipo is a powerful, fast, multi-thread, clustered and in-memory key-value database, with ability to configure token and acl on commands and key-regexes written by GO

Welcome to NIPO Nipo is a powerful, fast, multi-thread, clustered and in-memory key-value database, with ability to configure token and acl on command

Dec 28, 2022

Native, Protobuf & SQL-compliant objects used by offensive security tools.

Attacked Infrastructure Modular Specification (AIMS) Overview This repository aims to gather various declarations/specification of elements faced or n

Nov 19, 2021

A simple golang api generator that stores struct fields in key/value based databases

Backgen A simple golang API generator that uses key/value based databases. It does not provide the database itself, only uses a interface to access se

Feb 4, 2022
Comments
  • Bump github.com/buger/jsonparser from 1.0.0 to 1.1.1

    Bump github.com/buger/jsonparser from 1.0.0 to 1.1.1

    Bumps github.com/buger/jsonparser from 1.0.0 to 1.1.1.

    Release notes

    Sourced from github.com/buger/jsonparser's releases.

    v1.1.1

    Fix CVE-2020-35381. PR buger/jsonparser#221

    v1.1.0

    Christmas present 🎁

    Thanks to everyone who participated in the project! @​AllenX2018 @​saginadir @​xsandr @​nagesh4193 @​rrgilchrist @​floren @​AdamKorcz @​jlauinger

    Commits
    • df3ea76 Merge pull request #221 from d-hat/CVE-2020-35381
    • e015c37 Merge pull request #196 from AllenX2018/fix-issue-107
    • 1e1db9e handle "[" as a malformed array index by returning NotFound
    • d15cedb introduce some tests for malformed array indexes in GetString()
    • 9b2f299 Merge pull request #220 from saginadir/patch-2
    • ee29817 Small type fix in parser.go
    • 26b9301 Merge pull request #217 from buger/fuzz-update
    • 93ae43c Update to use built-in fuzz function
    • 1239415 Merge pull request #208 from xsandr/each-array-memory-optimization
    • 71a899e Merge pull request #213 from nagesh4193/master
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

  • json转换不了

    json转换不了

    [
      {
        "input_index": 0,
        "candidate_index": 0,
        "delivery_line_1": "1 N Rosedale St",
        "last_line": "Baltimore MD 21229-3737",
        "delivery_point_barcode": "212293737013",
        "components": {
          "primary_number": "1",
          "street_predirection": "N",
          "street_name": "Rosedale",
          "street_suffix": "St",
          "city_name": "Baltimore",
          "state_abbreviation": "MD",
          "zipcode": "21229",
          "plus4_code": "3737",
          "delivery_point": "01",
          "delivery_point_check_digit": "3"
        },
        "metadata": {
          "record_type": "S",
          "zip_type": "Standard",
          "county_fips": "24510",
          "county_name": "Baltimore City",
          "carrier_route": "C047",
          "congressional_district": "07",
          "rdi": "Residential",
          "elot_sequence": "0059",
          "elot_sort": "A",
          "latitude": 39.28602,
          "longitude": -76.6689,
          "precision": "Zip9",
          "time_zone": "Eastern",
          "utc_offset": -5,
          "dst": true
        },
        "analysis": {
          "dpv_match_code": "Y",
          "dpv_footnotes": "AABB",
          "dpv_cmra": "N",
          "dpv_vacant": "N",
          "active": "Y"
        }
      },
      {
        "input_index": 0,
        "candidate_index": 1,
        "delivery_line_1": "1 S Rosedale St",
        "last_line": "Baltimore MD 21229-3739",
        "delivery_point_barcode": "212293739011",
        "components": {
          "primary_number": "1",
          "street_predirection": "S",
          "street_name": "Rosedale",
          "street_suffix": "St",
          "city_name": "Baltimore",
          "state_abbreviation": "MD",
          "zipcode": "21229",
          "plus4_code": "3739",
          "delivery_point": "01",
          "delivery_point_check_digit": "1"
        },
        "metadata": {
          "record_type": "S",
          "zip_type": "Standard",
          "county_fips": "24510",
          "county_name": "Baltimore City",
          "carrier_route": "C047",
          "congressional_district": "07",
          "rdi": "Residential",
          "elot_sequence": "0064",
          "elot_sort": "A",
          "latitude": 39.2858,
          "longitude": -76.66889,
          "precision": "Zip9",
          "time_zone": "Eastern",
          "utc_offset": -5,
          "dst": true
        },
        "analysis": {
          "dpv_match_code": "Y",
          "dpv_footnotes": "AABB",
          "dpv_cmra": "N",
          "dpv_vacant": "N",
          "active": "Y"
        }
      }
    ]
    

    参考

Beerus-DB: a database operation framework, currently only supports Mysql, Use [go-sql-driver/mysql] to do database connection and basic operations

Beerus-DB · Beerus-DB is a database operation framework, currently only supports Mysql, Use [go-sql-driver/mysql] to do database connection and basic

Oct 29, 2022
Simple key value database that use json files to store the database

KValDB Simple key value database that use json files to store the database, the key and the respective value. This simple database have two gRPC metho

Nov 13, 2021
Export output from pg_stat_activity and pg_stat_statements from Postgres into a time-series database that supports the Influx Line Protocol (ILP).

pgstat2ilp pgstat2ilp is a command-line program for exporting output from pg_stat_activity and pg_stat_statements (if the extension is installed/enabl

Dec 15, 2021
This is a simple Golang application that executes SQL commands to clean up a mirror node's database.

This is a simple Golang application that executes SQL commands to clean up a mirror node's database.

Jan 24, 2022
Dolt is a SQL database that you can fork, clone, branch, merge, push and pull just like a git repository.

Dolt is a SQL database that you can fork, clone, branch, merge, push and pull just like a git repository. Connect to Dolt just like any MySQL database to run queries or update the data using SQL commands. Use the command line interface to import CSV files, commit your changes, push them to a remote, or merge your teammate's changes.

Dec 31, 2022
DonutDB: A SQL database implemented on DynamoDB and SQLite

DonutDB: A SQL database implemented on DynamoDB and SQLite

Dec 21, 2022
Owl is a db manager platform,committed to standardizing the data, index in the database and operations to the database, to avoid risks and failures.

Owl is a db manager platform,committed to standardizing the data, index in the database and operations to the database, to avoid risks and failures. capabilities which owl provides include Process approval、sql Audit、sql execute and execute as crontab、data backup and recover .

Nov 9, 2022
CockroachDB - the open source, cloud-native distributed SQL database.
CockroachDB - the open source, cloud-native distributed SQL database.

CockroachDB is a cloud-native SQL database for building global, scalable cloud services that survive disasters. What is CockroachDB? Docs Quickstart C

Jan 2, 2023
A decentralized, trusted, high performance, SQL database with blockchain features
A decentralized, trusted, high performance, SQL database with blockchain features

中文简介 CovenantSQL(CQL) is a Byzantine Fault Tolerant relational database built on SQLite: ServerLess: Free, High Availabile, Auto Sync Database Service

Jan 3, 2023
LBADD: An experimental, distributed SQL database
LBADD: An experimental, distributed SQL database

LBADD Let's build a distributed database. LBADD is an experimental distributed SQL database, written in Go. The goal of this project is to build a dat

Nov 29, 2022