mirror of https://github.com/jlelse/GoBlog
Lower case for all sql
This commit is contained in:
parent
5bb295b4ed
commit
a4a01d2c67
6
posts.go
6
posts.go
|
@ -119,11 +119,11 @@ func getPosts(context context.Context, config *postsRequestConfig) (posts []*Pos
|
||||||
paths := make(map[string]int)
|
paths := make(map[string]int)
|
||||||
var rows *sql.Rows
|
var rows *sql.Rows
|
||||||
if config.path != "" {
|
if config.path != "" {
|
||||||
rows, err = appDb.QueryContext(context, "select p.path, COALESCE(content, ''), COALESCE(published, ''), COALESCE(updated, ''), COALESCE(parameter, ''), COALESCE(value, '') from posts p left outer join post_parameters pp on p.path = pp.path where p.path=?", config.path)
|
rows, err = appDb.QueryContext(context, "select p.path, coalesce(content, ''), coalesce(published, ''), coalesce(updated, ''), coalesce(parameter, ''), coalesce(value, '') from posts p left outer join post_parameters pp on p.path = pp.path where p.path=?", config.path)
|
||||||
} else if config.limit != 0 || config.offset != 0 {
|
} else if config.limit != 0 || config.offset != 0 {
|
||||||
rows, err = appDb.QueryContext(context, "select p.path, COALESCE(content, ''), COALESCE(published, ''), COALESCE(updated, ''), COALESCE(parameter, ''), COALESCE(value, '') from posts p left outer join post_parameters pp on p.path = pp.path limit ? offset ?", config.limit, config.offset)
|
rows, err = appDb.QueryContext(context, "select p.path, coalesce(content, ''), coalesce(published, ''), coalesce(updated, ''), coalesce(parameter, ''), coalesce(value, '') from posts p left outer join post_parameters pp on p.path = pp.path limit ? offset ?", config.limit, config.offset)
|
||||||
} else {
|
} else {
|
||||||
rows, err = appDb.QueryContext(context, "select p.path, COALESCE(content, ''), COALESCE(published, ''), COALESCE(updated, ''), COALESCE(parameter, ''), COALESCE(value, '') from posts p left outer join post_parameters pp on p.path = pp.path")
|
rows, err = appDb.QueryContext(context, "select p.path, coalesce(content, ''), coalesce(published, ''), coalesce(updated, ''), coalesce(parameter, ''), coalesce(value, '') from posts p left outer join post_parameters pp on p.path = pp.path")
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue