- Support for ordering methods are improved: Now it supports
.order_by_field()
method before than.order_by()
method and chaining of.order_by_field()
methods.
- Added
.union()
and.union_all()
methods toQueryBuilder
Struct. Added support forUnion
andUnionAll
variants forKeywordlist
Enum.
- Length check added for every vector that passed on builders. Now if you pass an empty vector to any of the builders any method, builders will be panicked.
- Added Null value support for
QueryBuilder
struct.
FROM
trait implemented toValueType
enum.v2rc1
branch merged to main.
ValueType
Enum had breaking changes: Now we implementedDisplay
trait to it, now we don't have to give values with old cumbersome way. You can reach it's details on README.md or Official Documentation.- documentation updated, basic usages are shown for each query.
- added
.order_by_field()
method, which benefits to applyFIELD()
mysql function to query with it's synthax. .order_by()
function is modified, now it supports ORDER BY chaining.
- the implementation of
.like()
method modified, now it supports to come later than.where_cond()
,.where_in()
or.where_not_in()
methods. Previously, it was not produce correct queries when it used later then that methods because it also appliesWHERE
keywords for it's synthax. Now, you can use a different condition withWHERE
methods and later than use that method for searching for rows that both provide theWHERE
keywords condition. It searchs the needle on all the given columns seperately and takes the row if it exists on any of them.
- added
.copy()
method for getting the immutable copy of theQueryBuilder
struct. .json_extract()
method modified, now it supports multiple chaining ofJSON_EXTRACT()
method.
.json_extract()
and.json_contains()
functions are modified and their algorithm improved. Before that update, we assume you want to work with a column that is a json object and pointing a key. With that update, you can choose whether you want to work with a json array or json object, by simply putting a dot in the beginning of that function(for example, if you want to put "name" on the needle, you just have to make it ".name") or just select the which nth of that array with it's synthax.
- added
.json_contains()
method to theQueryBuilder
struct, which provides you to use "JSON_CONTAINS()" mysql function later than various keywords. Added many test cases to the tests. - added support for
HAVING
keyword with.having()
method.
- added proper documentation for most of the types. This release is just a documentation fix release.
- added
.json_extract()
method to theQueryBuilder
struct, which provides you to use "JSON_EXTRACT()" mysql function later than various keywords. Added many test cases to the tests. - added support for
GROUP BY
keyword with.group_by()
method. - The algorithm of
.order_by()
method slightly changed, it does not affect your existing codes though. - The actual usage of
KeywordList
enums are started with that release. AddedGroupBy
variant to it. - Now all methods add proper keywords for their last added query types to the
list
field. - added
.append_keyword()
method. Since we started to useKeywordList
enum to build queries correctly, you should append equivalent keyword with the string that you appended to original query with.append_custom()
method. Otherwise you should continue to build your entire query with.append_custom()
method, because you could easily encounter syntactic bugs.
- Made performance improvements by removing unnecessary copyings on
QueryBuilder
andSchemaBuilder
. - Project become stabilized. It continue to take more updates but it doesn't take a major one unless a breaking change happens on the synthax for very long time.
- Added proper documentation for
QueryBuilder
struct.
- Added
count()
constructor toQueryBuilder
struct for creating count queries and addedCount
variant toQueryType
andKeywordList
enums. Also addedIn
andNotIn
variants toKeywordList
enum.
- Added
.where_in()
,.where_not_in()
,.where_in_custom()
,.where_not_in_custom()
methods for usingIN
andNOT IN
operators.
- Added unix epoch times support for
Time
variant ofValueType
enum. If you give a value that's characters are fully convertible to integer or empty strings with thatTime
variant, it applies that value toFROM_UNIXTIME()
function and converts it to a validDATETIME
, so you can add them to column. If you want to store them directly as unix epoch times, then you have to set to column type asINT
in mysql and set theValueType
enum asInteger
variant.
- Added
Time
variant forValueType
enum. Added support for column types of time. That values and sql functions are supported to add as sql:UNIX_TIMESTAMP
,CURRENT_TIMESTAMP
,CURRENT_DATE
,CURRENT_TIME
,NOW()
,CURDATE()
,CURTIME()
. You can also time values as string. For now, unix epoch times are not supported.
- Added
append_custom()
function for my urgent need for using json functions on mysql. In later releases, json functions will be implemented toQueryBuilder
.
- Added
TableBuilder
struct and some implementations, which is enough for creating tables and adding relations. In next releases we'll implement other methods for altering tables. - Added
ForeignKey
andForeignKeyItems
structs andForeignKeyActions
enum and implementedDisplay
trait for that enum.
- Documentation fixed.
- Added
SchemaBuilder
struct and implementation, which enables you to create schemas. You can also createUSE
queries with that. - Now
.select()
constructor ofQueryBuilder
supportsSELECT *
queries by giving a vector of it's argument which first element is "*". - Added additional test cases.
- Upgraded the algorithm of
sanitize()
function for better sanitizing queries. Also addedKeywordList
enum and "list" field on builder. It lets us to more aggresively format the query string for specific cases.
upgraded the algorithm of sanitize()
function for better sanitizing queries.
qubl-rs liblary created.