Skip to content

增加Mssql和Postgres schema选项 - #713

Merged
wonderflow merged 9 commits into
qiniu:masterfrom
xxh2000:add_database_schema_option
Aug 20, 2018
Merged

wonderflow merged 9 commits into
qiniu:masterfrom
xxh2000:add_database_schema_option

Conversation

@xxh2000

@xxh2000 xxh2000 commented Aug 16, 2018

Copy link
Copy Markdown
Contributor

Fixes [issue number]

Changes

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

Comment thread reader/sql/sql.go Outdated
schemas: schemas,
encoder: encoder,
postgresSchema: pgSchema,
mssqlSchema: mssqlSchema,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok

@wonderflow wonderflow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

麻烦对代码进行下 go fmt

Comment thread reader/sql/sql.go
offsetKey, _ = conf.GetStringOr(reader.KeyMssqlOffsetKey, "")
dataSource, err = conf.GetString(reader.KeyMssqlDataSource)
dbSchema, _ = conf.GetStringOr(reader.KeyMssqlSchema, "dbo")
if err != nil {

Copy link
Copy Markdown
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判断下面,不要放在中间

Comment thread reader/sql/sql.go Outdated
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

同上

@wonderflow

Copy link
Copy Markdown
Contributor

lgtm

@wonderflow

Copy link
Copy Markdown
Contributor

ping @redHJ

Comment thread reader/rest_reader_models.go Outdated
ChooseOnly: false,
Placeholder: "<schema>",
DefaultNoUse: true,
Description: "数据库架构名称(mssql_schema)",

@redHJ redHJ Aug 20, 2018 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Comment thread reader/rest_reader_models.go Outdated
Placeholder: "<schema>",
DefaultNoUse: true,
Description: "数据库架构名称(mssql_schema)",
ToolTip: "数据库架构名称",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

同上

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Comment thread reader/rest_reader_models.go Outdated
Placeholder: "<schema>",
DefaultNoUse: true,
Description: "数据库架构名称(postgres_schema)",
ToolTip: "数据库架构名称",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

同上

@redHJ

redHJ commented Aug 20, 2018

Copy link
Copy Markdown
Collaborator

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

⌂ 换网址