Skip to content

Commit

Permalink
fix format duration
Browse files Browse the repository at this point in the history
  • Loading branch information
Sniper91 committed Oct 17, 2022
1 parent 1ba4703 commit 7e2dc53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,15 +603,15 @@ func (s *CreateDatabaseStatement) String() string {
_, _ = buf.WriteString(" WITH")
if s.RetentionPolicyDuration != nil {
_, _ = buf.WriteString(" DURATION ")
_, _ = buf.WriteString(s.RetentionPolicyDuration.String())
_, _ = buf.WriteString(FormatDuration(*s.RetentionPolicyDuration))
}
if s.RetentionPolicyReplication != nil {
_, _ = buf.WriteString(" REPLICATION ")
_, _ = buf.WriteString(strconv.Itoa(*s.RetentionPolicyReplication))
}
if s.RetentionPolicyShardGroupDuration > 0 {
_, _ = buf.WriteString(" SHARD DURATION ")
_, _ = buf.WriteString(s.RetentionPolicyShardGroupDuration.String())
_, _ = buf.WriteString(FormatDuration(s.RetentionPolicyShardGroupDuration))
}
if s.RetentionPolicyName != "" {
_, _ = buf.WriteString(" NAME ")
Expand Down Expand Up @@ -1405,8 +1405,8 @@ func (s *SelectStatement) RewriteFields(m FieldMapper) (*SelectStatement, error)
//
// Conditions that can currently be simplified are:
//
// - host =~ /^foo$/ becomes host = 'foo'
// - host !~ /^foo$/ becomes host != 'foo'
// - host =~ /^foo$/ becomes host = 'foo'
// - host !~ /^foo$/ becomes host != 'foo'
//
// Note: if the regex contains groups, character classes, repetition or
// similar, it's likely it won't be rewritten. In order to support rewriting
Expand Down

0 comments on commit 7e2dc53

Please sign in to comment.