Skip to content

Convert BLOBs to strings#195

Open
zauberen wants to merge 1 commit into
kostafey:masterfrom
zauberen:blob-display-mariadb
Open

Convert BLOBs to strings#195
zauberen wants to merge 1 commit into
kostafey:masterfrom
zauberen:blob-display-mariadb

Conversation

@zauberen

Copy link
Copy Markdown

Before, BLOBs would display an object reference since they are pulled as byte arrays. I noticed this in MariaDB specifically.

To test, run the following using ejc-sql, the blob column will appear like [B@73dbe1ae in master, with this PR you will see the actual value:

CREATE DATABASE test_db;
USE test_db;

CREATE TABLE storage_test (
    id INT AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    text_content TEXT,
    blob_content BLOB
);

INSERT INTO storage_test (title, text_content, blob_content)
VALUES (
    'lorem ipsum dolor sit amet.',
    'lorem ipsum dolor sit amet. lorem ipsum dolor sit amet.',
    'lorem ipsum dolor sit amet. lorem ipsum dolor sit amet. lorem ipsum dolor sit amet.'
);
select * from test_db.storage_test;

Before, BLOBs would display an object reference since they are pulled as byte
arrays.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant