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

增加Mssql和Postgres schema选项 #713

Merged
merged 9 commits into from
Aug 20, 2018

Conversation

xxh2000
Copy link
Contributor

@xxh2000 xxh2000 commented Aug 16, 2018

Fixes [issue number]

Changes

  • 增加Mssql和Postgres schema选项,支持读取某个schema中所有表的数据

schemas: schemas,
encoder: encoder,
postgresSchema: pgSchema,
mssqlSchema: mssqlSchema,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里可以就叫dbSchema,不用写三个

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor

@wonderflow wonderflow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

麻烦对代码进行下 go fmt

@@ -166,6 +166,7 @@ func NewReader(meta *reader.Meta, conf conf.MapConf) (reader.Reader, error) {
readBatch, _ = conf.GetIntOr(reader.KeyMssqlReadBatch, 100)
offsetKey, _ = conf.GetStringOr(reader.KeyMssqlOffsetKey, "")
dataSource, err = conf.GetString(reader.KeyMssqlDataSource)
dbSchema, _ = conf.GetStringOr(reader.KeyMssqlSchema, "dbo")
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这行 if err!=nil是紧跟着 dataSource的,你插入的这一行要么放在dataSource上面,要么放在error判断下面,不要放在中间

@@ -184,6 +185,7 @@ func NewReader(meta *reader.Meta, conf conf.MapConf) (reader.Reader, error) {
readBatch, _ = conf.GetIntOr(reader.KeyPGsqlReadBatch, 100)
offsetKey, _ = conf.GetStringOr(reader.KeyPGsqlOffsetKey, "")
dataSource, err = conf.GetString(reader.KeyPGsqlDataSource)
dbSchema, _ = conf.GetStringOr(reader.KeyPGsqlSchema, "public")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@wonderflow
Copy link
Contributor

lgtm

@wonderflow
Copy link
Contributor

ping @redHJ

ChooseOnly: false,
Placeholder: "<schema>",
DefaultNoUse: true,
Description: "数据库架构名称(mssql_schema)",
Copy link
Collaborator

@redHJ redHJ Aug 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

数据库 schema ?(我找了一下中文,基本都是叫架构或者模式,也不知道哪个好)

Placeholder: "<schema>",
DefaultNoUse: true,
Description: "数据库架构名称(mssql_schema)",
ToolTip: "数据库架构名称",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

开始想用模式,看到sqlserver 也有有用架构一词的,模式应该更通俗点

Placeholder: "<schema>",
DefaultNoUse: true,
Description: "数据库架构名称(postgres_schema)",
ToolTip: "数据库架构名称",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@redHJ
Copy link
Collaborator

redHJ commented Aug 20, 2018

lgtm

@wonderflow wonderflow merged commit 48514da into qiniu:master Aug 20, 2018
@xxh2000 xxh2000 deleted the add_database_schema_option branch August 27, 2018 09:34
redHJ added a commit that referenced this pull request Nov 4, 2019
logkit s3 和 cloudtrail 元数据目录生成逻辑不依赖ak/sk #713
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants