DML
DML stands for "Data Manipulation Language" and relates to inserting and modifying data in tables.
INSERT
Insert values into a table. If you are inserting values in all the columns of the table, use below query.
INSERT INTO
> INSERT INTO target_table VALUES (1, 'Foo'), (2, 'Bar');
+-------+
| count |
+-------+
| 2 |
+-------+
Update
Update existing rows using a SQL update query.
UPDATE target_table SET col1 = 1 WHERE col2 = 2;
DELETE
Deletes existing rows using a SQL delete query.
Placeholders
MekaDB supports placeholders in INSERT
and UPDATE
queries.
Both numeric and named placeholders can be used (NOT together, you must choose if a query will have numeric OR named parameters).
For example INSERT INTO target_table VALUES($1,$2)
, or UPDATE target_table SET col1 = :val1 WHERE col2 = :val2
.
Each client library allows you to pass the parameters. This is recommended whenever possible.
DELETE FROM target_table WHERE col2 = 2;
Large portions of this page is copied from the Apache Datafusion documentation on January 26th 2024 - where there have been customisations to match Hypi's deployment this has been noted. Apache Datafusion and the Apache name are the property of the Apache Foundation and licensed under the Apache V2 license .