Skip to content

Text format support for arrays #92

@Yourney

Description

@Yourney

create a table:

CREATE TABLE media
(
    id bigserial NOT NULL PRIMARY KEY,
    tags text[]
);

now do:

let rows = try connection.simpleQuery("SELECT * FROM media WHERE id = '1'").wait()

then loop through the fields and callon the tags column:
column.array(of: String.self)

The system dies here: Array b field did not equal zero.
version: Vapor Postgres-NIO: 1.0.0-rc.1.2
file: PostgresNIO>Data>PostgresData+Array.swift
line:78:

assert(b == 0, "Array b field did not equal zero")

The actual issue:
Please implement support for arrays in simpleQuery.

Low prio requests:

  1. please rename 'b' to a more useful name
  2. please throw an error that is more clear than the b == 0 assertion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions