Closed sevakalashnikov closed 3 years ago
Firstly, you don't need to build raw object for query()
.
Just put string as first parameter.
$db->query(file_get_contents($installFile));
And if still throws multiple command error, that's database engine not supported it. Just check out the database doc or setting.
I tried both with and without Medoo::raw
and still fails on a file with multiple statements like..
CREATE TABLE IF NOT EXISTS log (
id SERIAL,
inventory_id INTEGER NOT NULL,
user_id INTEGER,
item_id INTEGER,
action TEXT,
timestamp TIMESTAMP NOT NULL,
PRIMARY KEY (id)
);
CREATE INDEX inventory_id ON log ("inventory_id");
CREATE INDEX user_id ON log ("user_id");
That because the database didn't support that.
Just split it all into a single query and execute it alone.
Hello.
How can I import init db file with multiple postgres create and insert statements? I'm currently doing
which throws
Cannot insert multiple commands into a prepared statement
errorInformation
Detail Code Cannot insert multiple commands into a prepared statement
Expected output Import db dump file