All Projects → go-xorm → Cmd

go-xorm / Cmd

Licence: bsd-3-clause
Command line tools for database operation written by Go, moved to https://gitea.com/xorm/cmd

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Cmd

Sqlboiler
Generate a Go ORM tailored to your database schema.
Stars: ✭ 4,497 (+2820.13%)
Mutual labels:  orm, mysql, postgres, sqlite3
Grimoire
Database access layer for golang
Stars: ✭ 151 (-1.95%)
Mutual labels:  orm, mysql, postgres, sqlite3
Sworm
a write-only ORM for Node.js
Stars: ✭ 128 (-16.88%)
Mutual labels:  orm, mysql, sqlite3
Qb
The database toolkit for go
Stars: ✭ 524 (+240.26%)
Mutual labels:  orm, mysql, sqlite3
Lucid
AdonisJS official SQL ORM. Supports PostgreSQL, MySQL, MSSQL, Redshift, SQLite and many more
Stars: ✭ 613 (+298.05%)
Mutual labels:  orm, mysql, sqlite3
Openrecord
Make ORMs great again!
Stars: ✭ 474 (+207.79%)
Mutual labels:  orm, mysql, sqlite3
Rbatis
Rust ORM Framework High Performance Rust SQL-ORM(JSON based)
Stars: ✭ 482 (+212.99%)
Mutual labels:  orm, mysql, postgres
Mormot
Synopse mORMot ORM/SOA/MVC framework
Stars: ✭ 607 (+294.16%)
Mutual labels:  orm, mysql, sqlite3
Deno Nessie
A modular Deno library for PostgreSQL, MySQL, MariaDB and SQLite migrations
Stars: ✭ 381 (+147.4%)
Mutual labels:  mysql, postgres, sqlite3
Ebean
Ebean ORM
Stars: ✭ 1,172 (+661.04%)
Mutual labels:  orm, mysql, postgres
Xorm
Simple and Powerful ORM for Go, support mysql,postgres,tidb,sqlite3,mssql,oracle, Moved to https://gitea.com/xorm/xorm
Stars: ✭ 6,464 (+4097.4%)
Mutual labels:  orm, mysql, postgres
Electrocrud
Database CRUD Application Built on Electron | MySQL, Postgres, SQLite
Stars: ✭ 1,267 (+722.73%)
Mutual labels:  mysql, postgres, sqlite3
Gnorm
A database-first code generator for any language
Stars: ✭ 415 (+169.48%)
Mutual labels:  orm, mysql, postgres
Denodb
MySQL, SQLite, MariaDB, PostgreSQL and MongoDB ORM for Deno
Stars: ✭ 498 (+223.38%)
Mutual labels:  orm, mysql, sqlite3
Walkable
A Clojure(script) SQL library for building APIs: Datomic® (GraphQL-ish) pull syntax, data driven configuration, dynamic filtering with relations in mind
Stars: ✭ 384 (+149.35%)
Mutual labels:  orm, mysql, sqlite3
Lithium
Easy to use C++17 HTTP Server with no compromise on performances. https://matt-42.github.io/lithium
Stars: ✭ 523 (+239.61%)
Mutual labels:  orm, mysql, sqlite3
Architect
A set of tools which enhances ORMs written in Python with more features
Stars: ✭ 320 (+107.79%)
Mutual labels:  orm, mysql, postgres
Crecto
Database wrapper and ORM for Crystal, inspired by Ecto
Stars: ✭ 325 (+111.04%)
Mutual labels:  orm, mysql, postgres
Vscode Sqltools
Database management for VSCode
Stars: ✭ 741 (+381.17%)
Mutual labels:  mysql, postgres, sqlite3
Prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite & MongoDB (Preview)
Stars: ✭ 18,168 (+11697.4%)
Mutual labels:  orm, mysql, postgres

中文

xorm tools

xorm tools is a set of tools for database operation.

Source Install

go get github.com/go-xorm/cmd/xorm

and you should install the depends below:

** For sqlite support, you need build via go build -tags sqlite3 because of this driver ask cgo.

Commands

All the commands below.

  • reverse reverse a db to codes
  • shell a general shell to operate all kinds of database
  • dump dump database all table struct's and data to standard output
  • source execute a sql from std in
  • driver list all supported drivers

Reverse

Reverse command is a tool to convert your database struct to all kinds languages of structs or classes. After you installed the tool, you can type

xorm help reverse

to get help

example:

cd $GOPATH/src/github.com/go-xorm/cmd/xorm

sqlite: xorm reverse sqite3 test.db templates/goxorm

mysql: xorm reverse mysql root:@/xorm_test?charset=utf8 templates/goxorm

mymysql: xorm reverse mymysql xorm_test2/root/ templates/goxorm

postgres: xorm reverse postgres "dbname=xorm_test sslmode=disable" templates/goxorm

mssql: xorm reverse mssql "server=test;user id=testid;password=testpwd;database=testdb" templates/goxorm

will generated go files in ./model directory

Template and Config

Now, xorm tool supports go and c++ two languages and have go, goxorm, c++ three of default templates. In template directory, we can put a config file to control how to generating.

lang=go
genJson=1

lang must be go or c++ now. genJson can be 1 or 0, if 1 then the struct will have json tag.

Shell

Shell command provides a tool to operate database. For example, you can create table, alter table, insert data, delete data and etc.

xorm shell sqlite3 test.db will connect to the sqlite3 database and you can type help to list all the shell commands.

Dump

Dump command provides a tool to dump all database structs and data as SQL to your standard output.

xorm dump sqlite3 test.db could dump sqlite3 database test.db to standard output. If you want to save to file, just type xorm dump sqlite3 test.db > test.sql.

Source

xorm source sqlite3 test.db < test.sql will execute sql file on the test.db.

Driver

List all supported drivers since default build will not include sqlite3.

LICENSE

BSD License http://creativecommons.org/licenses/BSD/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].