Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add global variable QueryClauses #65

Merged
merged 1 commit into from Mar 2, 2022
Merged

add global variable QueryClauses #65

merged 1 commit into from Mar 2, 2022

Commits on Mar 1, 2022

  1. add global variable QueryClauses

    add a global variable QueryClause. 
    So we can add our own Clause before create a gorm.DB.
    
    ``` go
    // add WINDOW clause
    mysql.QueryClauses = []string{"SELECT", "FROM", "WHERE", "WINDOW", "GROUP BY", "ORDER BY", "LIMIT", "FOR"}
    gorm.Open(mysql.Open(dsn))
    ```
    
    我想给 gorm 写一个解析 WINDOW 窗口函数的库。
    但 mysql 并没有提供全局变量 QueryClause。
    所以我不能通过修改全局变量的方式去 RegisterDefaultCallbacks。
    kvii committed Mar 1, 2022
    Copy the full SHA
    dfca1d2 View commit details
    Browse the repository at this point in the history