Skip to content

BLOB node.js Buffer Support #140

@eugeneware

Description

@eugeneware

Currently if you pass a binary node.js Buffer object through (say an INSERT) statement, it gets coerced to a string.

For binary data it should probably convert the data to:

INSERT INTO mytable (blobvalue) VALUE (x'DEADBEAF');

For mysql and sqlite.

And for postgres:

INSERT INTO mytable (blobvalue) VALUE (decode('DEADBEAF', 'hex'));

Also, for create table statements, consider converting:

    var mytable = sql.Table.define({
      name: 'mytable',
      columns: [
        {
          name: 'key',
          dataType: 'BLOB'
        },
        {
          name: 'value',
          dataType: 'BLOB'
        }
      ]
    });

to a dataType of 'BYTEA' for postgres.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions