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

contain two fix and a feature #97

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

sillydong
Copy link

  1. replace \n to space in postgresql comments
  2. check if schemaname exists to avoid panic
  3. add step support

Chen.Zhidong added 3 commits April 20, 2018 10:00
Fix: error calling makeTable: failed to render from pipe delimited bytes: record on line 4: wrong number of fields
The old way may cause panic when the retrieved table name don’t contain schema name.
for convenience
@sillydong sillydong changed the title cotain two fix and a feature contain two fix and a feature Apr 20, 2018
environ/funcs.go Outdated
@@ -138,6 +139,15 @@ func numbers(start, end int) data.Strings {
return s
}

// steps returns a live of strings of the numbers start with size of len
Copy link
Member

Choose a reason for hiding this comment

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

What's a "live" of strings? I don't really understand this comment at all and I can't infer from the code what it's supposed to say.

Copy link
Author

Choose a reason for hiding this comment

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

That was a misspell. steps act like numbers return a string from start with the length of len.

@@ -535,7 +537,8 @@ func queryColumnComments(log *log.Logger, db *sql.DB, schemaNames []string) ([]c
}

if c.Valid {
r.Comment = c.String
replaced := strings.Replace(c.String, "\n", " ", -1)
Copy link
Member

Choose a reason for hiding this comment

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

What's the rationale for this change? Might a newline not be a significant part of the comment?

Copy link
Author

Choose a reason for hiding this comment

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

If there is \n in comment in pg, gnorm will throw error:

error calling makeTable: failed to render from pipe delimited bytes: record on line 4: wrong number of fields

This is about to fix it.

Choose a reason for hiding this comment

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

I just ran into this issue with some of the comments in my database. Can this be merged?

Copy link

Choose a reason for hiding this comment

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

Then again, this might not be the right fix. I believe I ran into this issue when running gnorm preview on a comment containing | and ). Is there an existing issue ticket for this?

Copy link
Author

@sillydong sillydong Nov 25, 2019

Choose a reason for hiding this comment

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

This pr was about to fix \n in comment. I didn't meet the | or ) issue before.

Copy link
Author

Choose a reason for hiding this comment

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

For | and ), may be needs more strings.Replace

@sillydong
Copy link
Author

Any update about this issue? Do I need to do modifies?

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.

None yet

3 participants