8000 Releases · doytowin/goooqo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Releases: doytowin/goooqo

v0.2.3

09 May 13:42
68fdcee
Compare
Choose a tag to compare

What's Changed

  • Support querying entities with related entities by abstract entity path tag.
  • Support CRUD for association tables.
  • Rename gen to gooogen as a go:generate tool.
  • Enhance generation for SQL builder.

Usages:

gooogen

  1. Define the go:generate gooogen command before a query struct:
//go:generate gooogen
type UserQuery struct {
	PageQuery
	IdGt     *int
	IdIn     *[]int
	//...
}
  1. Run the go generate command to generate the corresponding query construction methods in the specified file.

Check the README or the document for more details.

v0.2.2

13 Oct 08:10
6cfcac8
Compare
Choose a tag to compare

Versions

  • core/v0.2.2
  • rdb/v0.2.2
  • web/v0.2.2

Features

rdb

  • support many-to-many/one-to-many/many-to-one/one-to-one queries
  • ignore blank strings for the LIKE condition
  • ignore empty splices for In/NotIn
  • remove suffix Not

web

  • make ResolveQuery public

Example for ER queries

Table t_menu has a column parent_id referring to the id column itself as a foreign key.
The parent_id column is used to define the hierarchical parent-child relationship between menu items.
The menus are assigned to the users as a system resource via a general RBAC model.

import . "github.com/doytowin/goooqo/core"

type MenuEntity struct {
	IntId
	ParentId *int    `json:"parentId,omitempty"`
	Name     *string `json:"name,omitempty"`
}

type MenuQuery struct {
	PageQuery
	Id *int

	// many-to-one:
	// Query the submenus of a specific parent menu:
	// parent_id IN (SELECT id FROM t_menu WHERE [conditions])
	Parent *MenuQuery `entitypath:"menu" localField:"ParentId"`

	// one-to-many:
	// Query the parent menu of a specific submenu:
	// id IN (SELECT parent_id FROM t_menu WHERE [conditions])
	Children *MenuQuery `entitypath:"menu" foreignField:"ParentId"`

	/**
	many-to-many:
	Query the menus accessible to a specific user:
	id IN (
		SELECT menu_id FROM a_perm_and_menu WHERE perm_id IN (
			SELECT perm_id FROM a_role_and_perm WHERE role_id IN (
				SELECT role_id FROM a_user_and_role WHERE user_id IN (
					SELECT id FROM t_user WHERE [conditions]
				)
			)
		)
	)*/
	User *UserQuery `entitypath:"menu,perm,role,user"`
}

For more details. check https://goooqo.docs.doyto.win/query-mapping/query-object/er-query-field .

v0.2.2-pre.1

13 Oct 04:28
1230b79
Compare
Choose a tag to compare
v0.2.2-pre.1 Pre-release
Pre-release

test

v0.2.0

19 Sep 09:27
b2a73ed
Compare
Choose a tag to compare

Features:

  • support subquery field mapping
    • Tag: subquery
    • Tag: select/from
    • Condition from name
    • ANY
    • ALL

Examples for subquery mapping:

type UserQuery struct {
	PageQuery
	//...

	ScoreLtAvg *UserQuery `subquery:"select avg(score) from User"`
	ScoreLtAny *UserQuery `subquery:"SELECT score FROM User"`
	ScoreLtAll *UserQuery `subquery:"select score from UserEntity"`

	ScoreGtAvg *UserQuery `select:"avg(score)" from:"UserEntity"`

	ScoreInScoreOfUser    *UserQuery
	ScoreGtAvgScoreOfUser *UserQuery
}

Full Changelog: v0.1.4...v0.2.0

v0.1.4

04 Sep 14:00
39899c1
Compare
Choose a tag to compare

Full Changelog: v0.1.3...v0.1.4

  • add config for JSON intent
  • recover for panic transaction
  • add callback style transaction
  • [core] add IntId
  • [rdb] refactor SQL logging
  • [rdb] Build Or Clause with And
  • [rdb] Build Or Clause for basic type array
  • [rdb] Build OR clause for struct array

v0.1.3

26 Aug 03:02
0a9cf84
Compare
Choose a tag to compare

Full Changelog: v0.1.2...v0.1.3

  • [core] export Int64Id
  • [web] support PATCH /user/
  • [web] support DELETE /user/
  • [web] support lowercase for parameter names
  • [rdb] support suffix Rx
  • [rdb] fix type for field ending with Null
  • [gen] add GenerateCodeToFile
  • [gen] support rdb Null with *bool

v0.1.2

27 Jun 07:43
60d4401
Compare
Choose a tag to compare
  • Add generator module.
  • Add MongoDB support for a single table.

GoooQo-0.1.1

17 Jan 13:39
7696224
Compare
Choose a tag to compare
  • Add transaction support
  • Add subquery support
  • Add custom clause support
  • Add sort support
  • Support Count/Create/Update/Patch/Delete
  • Support suffix Like|NotLike|Contain|NotContain|Start|NotStart|End|NotEnd
  • Add web module

0.1.0

28 Nov 03:35
0e147ad
Compare
Choose a tag to compare
  • Add DataAccess Interface
  • Add Paging Support
  • Add Delete/DeleteById
  • Support OR clause

0.0.2

27 Nov 12:23
1570425
Compare
Choose a tag to compare

Add goquery.Get

0