So you can `go build -tags=jsoniter` to use `github.com/json-iterator/go` as default json handler
Fix#1744
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1916
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
Byte strings in postgres are actually E'\x...' not 0x...
This is part of the follow-up to #1872
Signed-off-by: Andrew Thornton <art27@cantab.net>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1906
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-committed-by: Andrew Thornton <art27@cantab.net>
Ensure that structs, arrays and slices are properly converted to strings.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1905
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-committed-by: Andrew Thornton <art27@cantab.net>
There are two issues with #1872 which have become apparent
after testing on Gitea.
1. Ensure structs which are have before processors run correctly
2. Ensure structs extending other structs work
3. Ensure that numerical enums become numeric
Signed-off-by: Andrew Thornton <art27@cantab.net>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1903
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-committed-by: Andrew Thornton <art27@cantab.net>
When using dumptables to convert between dialects if a struct is provided we should use it to generate the SQL types rather than infer them by mapping from the sql types.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1872
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-committed-by: Andrew Thornton <art27@cantab.net>
This PR add support to MySQL, for other databases unsigned type will be downgrade to the related signed type.
Replace #1810
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1889
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
MariaDB when encountering an old datetime type will add a suffix of /* mariadb-5.3 */
on its schema information page. Xorm does not understand this and then its mappings
fail.
The simplest solution is just to remove any fixed suffix and that is what this PR does
- a clever solution would look for and remove any comments or match them.
See https://mariadb.com/kb/en/time/ for more details about the comment.
Related: https://github.com/go-gitea/gitea/issues/15277
Signed-off-by: Andrew Thornton <art27@cantab.net>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1885
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-committed-by: Andrew Thornton <art27@cantab.net>
#1864 Export tag identifier so we can change that form `xorm` to others
This will be useful when in some migration scenarios such as migrate `sqlx` to `xorm`, the former uses `db` as the identifier and has a very simple rule which can be covered by xorm parser rules
Co-authored-by: clannadxr <clannadxr@hotmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1865
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: clannadxr <clannadxr@noreply.gitea.io>
Co-committed-by: clannadxr <clannadxr@noreply.gitea.io>
1. add: support xml column type for mssql.
2. fix: array index overflow when getindexs caused by unregular indexname(eg.idx_(tablename))
Co-authored-by: Rick <lonelyangel.jcw@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1852
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: L-Angel <l-angel@noreply.gitea.io>
Co-committed-by: L-Angel <l-angel@noreply.gitea.io>