Skip to content

Commit

Permalink
Merge pull request #59 from flycash/main
Browse files Browse the repository at this point in the history
改名为 eorm, 并且改为纯中文项目
  • Loading branch information
flycash authored May 13, 2022
2 parents 39861fc + 1dc491e commit e39f77a
Show file tree
Hide file tree
Showing 36 changed files with 107 additions and 110 deletions.
61 changes: 31 additions & 30 deletions .CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
## Developing
- [Init Project](https://github.com/gotomicro/eql/pull/1)
- [Selector Definition](https://github.com/gotomicro/eql/pull/2)
- [Deleter Definition](https://github.com/gotomicro/eql/pull/4)
- [Updater Definition](https://github.com/gotomicro/eql/pull/8)
- [Rft: remove NilAsNullFunc](https://github.com/gotomicro/eql/pull/48)
- [Metadata API](https://github.com/gotomicro/eql/pull/16)
- [Add model register examples](https://github.com/gotomicro/eql/pull/54)
- [tagMetaRegistry: default implementation of MetaRegistry](https://github.com/gotomicro/eql/pull/25)
- [Rft: remove defaultRegistry](https://github.com/gotomicro/eql/pull/46)
- [Use `bytebufferpool` for builder](https://github.com/gotomicro/eql/pull/39)
- [Refactor: move Insert function into db.file](https://github.com/gotomicro/eql/pull/28)
- [Selector implementation, excluding WHERE and HAVING clauses](https://github.com/gotomicro/eql/pull/32)
- [Ignore columns by Tag and Option](https://github.com/gotomicro/eql/pull/49)
- [Selector WHERE clause](https://github.com/gotomicro/eql/pull/40)
- [Support Aggregate Functions](https://github.com/gotomicro/eql/pull/37)
- [Updater implementation, excluding WHERE clause](https://github.com/gotomicro/eql/pull/36)
- [Force test and lint in pre-push](https://github.com/gotomicro/eql/pull/35)
- [Insert implementation ](https://github.com/gotomicro/eql/pull/38)
- [Delete implementation ](https://github.com/gotomicro/eql/pull/43)
- [Having implementation ](https://github.com/gotomicro/eql/pull/45)
- [RawExpr accepts arguments ](https://github.com/gotomicro/eql/pull/53)
- [Support having with alias functions](https://github.com/gotomicro/eql/pull/55)
- [Add `NewSelector` function](https://github.com/gotomicro/eql/pull/56)
- [Support using `RawExpr` as `Predicate`](https://github.com/gotomicro/eql/pull/57)
- [Remove WithNil and WithZero function](https://github.com/gotomicro/eql/pull/58)
## 开发中:
- [Init Project](https://github.com/gotomicro/eorm/pull/1)
- [Selector Definition](https://github.com/gotomicro/eorm/pull/2)
- [Deleter Definition](https://github.com/gotomicro/eorm/pull/4)
- [Updater Definition](https://github.com/gotomicro/eorm/pull/8)
- [Rft: remove NilAsNullFunc](https://github.com/gotomicro/eorm/pull/48)
- [Metadata API](https://github.com/gotomicro/eorm/pull/16)
- [Add model register examples](https://github.com/gotomicro/eorm/pull/54)
- [tagMetaRegistry: default implementation of MetaRegistry](https://github.com/gotomicro/eorm/pull/25)
- [Rft: remove defaultRegistry](https://github.com/gotomicro/eorm/pull/46)
- [Use `bytebufferpool` for builder](https://github.com/gotomicro/eorm/pull/39)
- [Refactor: move Insert function into db.file](https://github.com/gotomicro/eorm/pull/28)
- [Selector implementation, excluding WHERE and HAVING clauses](https://github.com/gotomicro/eorm/pull/32)
- [Ignore columns by Tag and Option](https://github.com/gotomicro/eorm/pull/49)
- [Selector WHERE clause](https://github.com/gotomicro/eorm/pull/40)
- [Support Aggregate Functions](https://github.com/gotomicro/eorm/pull/37)
- [Updater implementation, excluding WHERE clause](https://github.com/gotomicro/eorm/pull/36)
- [Force test and lint in pre-push](https://github.com/gotomicro/eorm/pull/35)
- [Insert implementation ](https://github.com/gotomicro/eorm/pull/38)
- [Delete implementation ](https://github.com/gotomicro/eorm/pull/43)
- [Having implementation ](https://github.com/gotomicro/eorm/pull/45)
- [RawExpr accepts arguments ](https://github.com/gotomicro/eorm/pull/53)
- [Support having with alias functions](https://github.com/gotomicro/eorm/pull/55)
- [Add `NewSelector` function](https://github.com/gotomicro/eorm/pull/56)
- [Support using `RawExpr` as `Predicate`](https://github.com/gotomicro/eorm/pull/57)
- [Remove WithNil and WithZero function](https://github.com/gotomicro/eorm/pull/58)
- [改名为 eorm, 并且改为纯中文项目](https://github.com/gotomicro/eorm/pull/59)

### Docs, Lint issues and Examples
- [Add examples and docs for Aggregate and Assign](https://github.com/gotomicro/eql/pull/50)
- [Add examples for Column and columns](https://github.com/gotomicro/eql/pull/51)
- [Add examples for DB, Predicate, Deleter, Inserter](https://github.com/gotomicro/eql/pull/52)
### 文档, 代码质量以及文档
- [Add examples and docs for Aggregate and Assign](https://github.com/gotomicro/eorm/pull/50)
- [Add examples for Column and columns](https://github.com/gotomicro/eorm/pull/51)
- [Add examples for DB, Predicate, Deleter, Inserter](https://github.com/gotomicro/eorm/pull/52)
2 changes: 1 addition & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ name = "go"
enabled = true

[analyzers.meta]
import_root = "github.com/gotomicro/eql"
import_root = "github.com/gotomicro/eorm"
dependencies_vendored = false

[[analyzers]]
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: ''

#### English Only

Please check [existing issues](https://github.com/gotomicro/eql/issues) first to avoid duplication and answer the questions below before submitting your issue.
Please check [existing issues](https://github.com/gotomicro/eorm/issues) first to avoid duplication and answer the questions below before submitting your issue.

### Issue Type

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/enhancement-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: ''

#### English Only

Please check [existing issues](https://github.com/gotomicro/eql/issues) first to avoid duplication and answer the questions below before submitting your issue.
Please check [existing issues](https://github.com/gotomicro/eorm/issues) first to avoid duplication and answer the questions below before submitting your issue.

Please take note Enhancement is a suggestion to existing features and codebase.
If you're requesting for a new feature, please select Feature.
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: ''

#### English Only

Please check [existing issues](https://github.com/gotomicro/eql/issues) first to avoid duplication and answer the questions below before submitting your issue.
Please check [existing issues](https://github.com/gotomicro/eorm/issues) first to avoid duplication and answer the questions below before submitting your issue.

### Use case(s)

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: ''

#### English Only

Please check [existing issues](https://github.com/gotomicro/eql/issues) first to avoid duplication and answer the questions below before submitting your issue.
Please check [existing issues](https://github.com/gotomicro/eorm/issues) first to avoid duplication and answer the questions below before submitting your issue.

### What version of EQL are you using?

Expand Down
4 changes: 2 additions & 2 deletions .github/linters/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ linters:

linters-settings:
gci:
local-prefixes: github.com/gotomicro/eql
local-prefixes: github.com/gotomicro/eorm
goimports:
local-prefixes: github.com/gotomicro/eql
local-prefixes: github.com/gotomicro/eorm
40 changes: 18 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
# EQL
# EORM

[![codecov](https://codecov.io/gh/gotomicro/eql/branch/main/graph/badge.svg?token=vc0BDor3Lk)](https://codecov.io/gh/gotomicro/eql)
[![codecov](https://codecov.io/gh/gotomicro/eorm/branch/main/graph/badge.svg?token=vc0BDor3Lk)](https://codecov.io/gh/gotomicro/eorm)

An easy-use SQL builder.
简单的 ORM 框架。

## SQL 2003 Standard
In theory, we try to support the [SQL 2003 standard](https://ronsavage.github.io/SQL/sql-2003-2.bnf.html#query%20specification). But as we know, some databases do not follow the standard. These databases have its own feature, and we will support these grammers in the future.
> 注意:这是一个全中文的仓库。这意味着注释、文档和错误信息,都会是中文的。介意的用户可以选择 GORM,这也是一个杰出的 ORM 仓库
## Design
## SQL 2003 标准
理论上来说,我们计划支持 [SQL 2003 standard](https://ronsavage.github.io/SQL/sql-2003-2.bnf.html#query%20specification). 不过据我们所知,并不是所有的数据库都支持全部的 SQL 2003 标准,所以用户还是需要进一步检查目标数据库的语法。

We are not English native speaker, so we use Chinese to write the design documents. We plan to translate them to English. Or you can use some software to translate it.

Here is a good one: https://www.deepl.com/en/translator
## 设计

[设计思路](./docs/design.md)

[B站视频](https://space.bilibili.com/324486985)

## Contribution
## 加入我们

You must follow these rules:
- One commit one PR
- You must add change log to `.CHANGELOG.md` file
- You must add license header to every new files
我们欢迎任何人给我们提合并请求,但是我们希望合并请求能够做到:
- 一个合并请求一个 Commit ID
- 自己要先确保合并请求能够通过 CI
- 我们使用 uber 的[代码风格](https://github.com/uber-go/guide/blob/master/style.md)

[style guide](https://github.com/uber-go/guide/blob/master/style.md)
### 设置开发环境

### Setup Develop Environment
如果你是 Windows 用户,那么我们建议你使用 WSL,因为这个仓库会使用到一个 Unix 命令来帮助构建、测试等。

#### install golangci-lint
Please refer [Install golangci-lint](https://golangci-lint.run/usage/install/)
#### setup pre-push github hook
Please move the `.github/pre-push` to your `.git` directory
#### 安装 golangci-lint
参考 [Install golangci-lint](https://golangci-lint.run/usage/install/)
#### 设置 pre-push github hook
`.github/pre-push` 复制到本仓库的 `.git` 目录下
2 changes: 1 addition & 1 deletion aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

// Aggregate represents aggregate expression, including AVG, MAX, MIN...
type Aggregate struct {
Expand Down
2 changes: 1 addition & 1 deletion aggregate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

// Assignable represents that something could be used as "assignment" statement
type Assignable interface {
Expand Down
2 changes: 1 addition & 1 deletion assignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

import "fmt"

Expand Down
12 changes: 6 additions & 6 deletions builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

import (
"errors"
"github.com/gotomicro/eql/internal"
"github.com/gotomicro/eorm/internal"
"github.com/valyala/bytebufferpool"
)

Expand All @@ -43,21 +43,21 @@ type builder struct {
aliases map[string]struct{}
}

func (b builder) quote(val string) {
func (b *builder) quote(val string) {
_ = b.buffer.WriteByte(b.dialect.quote)
_, _ = b.buffer.WriteString(val)
_ = b.buffer.WriteByte(b.dialect.quote)
}

func (b builder) space() {
func (b *builder) space() {
_ = b.buffer.WriteByte(' ')
}

func (b builder) end() {
func (b *builder) end() {
_ = b.buffer.WriteByte(';')
}

func (b builder) comma() {
func (b *builder) comma() {
_ = b.buffer.WriteByte(',')
}

Expand Down
2 changes: 1 addition & 1 deletion builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

import "fmt"

Expand Down
2 changes: 1 addition & 1 deletion column.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

// Column represents column
// it could have alias
Expand Down
2 changes: 1 addition & 1 deletion column_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

import "fmt"

Expand Down
2 changes: 1 addition & 1 deletion db.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

import (
"github.com/valyala/bytebufferpool"
Expand Down
2 changes: 1 addition & 1 deletion db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

import (
"fmt"
Expand Down
6 changes: 3 additions & 3 deletions delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

// Deleter builds DELETE query
type Deleter struct {
Expand Down Expand Up @@ -54,7 +54,7 @@ func (d *Deleter) From(table interface{}) *Deleter {
}

// Where accepts predicates
func (d *Deleter) Where(predicates...Predicate) *Deleter {
func (d *Deleter) Where(predicates ...Predicate) *Deleter {
d.where = predicates
return d
}
}
2 changes: 1 addition & 1 deletion delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion dialect.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

// Dialect specify config or behavior of special SQL dialects
type Dialect struct {
Expand Down
2 changes: 1 addition & 1 deletion expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

// Expr is the top interface. It represents everything.
type Expr interface {
Expand Down
2 changes: 1 addition & 1 deletion expression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/gotomicro/eql
module github.com/gotomicro/eorm

go 1.17

Expand Down
2 changes: 1 addition & 1 deletion insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion insert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package eql
package eorm

import (
"errors"
Expand Down
4 changes: 2 additions & 2 deletions model.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package eql
package eorm

import (
"reflect"
"strings"
"sync"

"github.com/gotomicro/eql/internal"
"github.com/gotomicro/eorm/internal"
)

// TableMeta represents data model, or a table
Expand Down
Loading

0 comments on commit e39f77a

Please sign in to comment.