Replies: 3 comments 2 replies
-
ArcadeDB doesn't support BLOB records like OrientDB. However, you can store binary data in record properties:
Of course, solution 1 is the most efficient. To emulate the BLOB record you could create a Blob type with only one property of binary type and use that. Example: public class BLOBTest extends TestHelper {
@Override
public void beginTest() {
database.transaction(() -> {
DocumentType type = database.getSchema().createDocumentType("Blob");
type.createProperty("binary", Type.BINARY);
});
}
@Test
public void testWriteAndRead() {
database.transaction(() -> {
final MutableDocument blob = database.newDocument("Blob");
blob.set("binary", "This is a test".getBytes());
blob.save();
});
database.transaction(() -> {
final Document blob = database.iterateType("Blob", false).next().asDocument();
Assertions.assertEquals("This is a test", new String( blob.getBinary("binary")));
});
}
} NOTE: The example above compiles only with the latest 22.10.1-SNAPSHOT because of the new About the other 2 questions: |
Beta Was this translation helpful? Give feedback.
-
Thank you @lvca. I am just adding SQL commands which might be useful for newcomers how to use binary data over HTTP/SQL. Create BINARY property via SQL: First take your binary data, e.g., "light work." and generate base64 representation (you can use online tools for ASCII or HEX transformation into base64 for initial manual tests). In our case, we get "bGlnaHQgd29yay4=". Then execute |
Beta Was this translation helpful? Give feedback.
-
@lvca i've seen in documentation that the BINARY type has a 2GB limit, but there is no limit mentioned in string. Can string store larger then that, for example 10GB, of base64 data? If yes; is it wise or should we look for an external storage coupling for those? |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I have few questions on ArcadeDB since I am in the decision process if I should choose OrientDB or ArcadeDB for my project.
ORecordBytes
(https://orientdb.com/docs/last/java/Binary-Data.html).ORecordBytes
in OrientDB?Thank you,
Michael
Beta Was this translation helpful? Give feedback.
All reactions