Skip to content
/ tigql Public

tigql is a graphql engine for tidb and mysql, help expose your database as static or dynamic api easier

License

Notifications You must be signed in to change notification settings

tigql/tigql

Repository files navigation

tigql

test result

tigql is a graphql engine for tidb and mysql, help expose your database as static or dynamic api easier.

  • static means you can easily write CRUD code.
  • dynamic means you can expose database data directly as graphql(like hasura) or rpc call.

dev

# start mysql
docker-compose up mysql57

# install
make install

# start with live reload
make dev

static

// connect to schema testdb
db := mysql.Open("my://root:mypass@localhost:33308/testdb")

// ddl
db.Tables("namePattern") // basic info of tables
db.Table("tableName") // detail info of the table

// data
db.FindAll("posts")
db.FindById("posts", 1)
db.Find("posts", "title = :title and created_at >= :time", name, time)

// native sql
sql := `
    select author, title, created
      from posts
      where author = :author
`
d.Sql(sql, author)

dynamic

visit http://localhost:8080/ for graphql playground, try query

query findTables {
  tables {
    name
    type
    comment
    def
    createdAt
  }
}

thanks

About

tigql is a graphql engine for tidb and mysql, help expose your database as static or dynamic api easier

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published