Skip to content

Commit 79ce0d3

Browse files
committed
fix linter
1 parent a95e6db commit 79ce0d3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

linglet/sql/psql.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Pay attention to use only the column names you can see in the tables below. Be c
1414
Pay attention to use date('now') function to get the current date, if the question involves "today". Do not use markdown to format the query.`
1515

1616
// psqlSchema retrieves the schema information for all tables in a PostgreSQL database.
17+
//
18+
//nolint:funlen,gocognit
1719
func (s *SQL) psqlSchema() (*string, error) {
1820
rows, err := s.db.Query(`
1921
SELECT
@@ -48,11 +50,14 @@ func (s *SQL) psqlSchema() (*string, error) {
4850
currentTable := ""
4951

5052
for rows.Next() {
53+
//nolint:lll
5154
var tableName, columnName, dataType, columnDefault, isNullable, constraintType, constraintName, foreignTableName, foreignColumnName sql.NullString
55+
//nolint:lll
5256
if err := rows.Scan(&tableName, &columnName, &dataType, &columnDefault, &isNullable, &constraintType, &constraintName, &foreignTableName, &foreignColumnName); err != nil {
5357
return nil, fmt.Errorf("scanning row: %w", err)
5458
}
5559

60+
//nolin:nestif
5661
if tableName.Valid && tableName.String != currentTable {
5762
if currentTable != "" {
5863
schema += "\n" // Add a newline before a new table
@@ -81,7 +86,6 @@ func (s *SQL) psqlSchema() (*string, error) {
8186

8287
schema += "\n"
8388
}
84-
8589
}
8690

8791
if err := rows.Err(); err != nil {

0 commit comments

Comments
 (0)