Loading MySQL tables
To mount a MySQL database into the sgr
engine using
mysql_fdw
, run:
$ sgr mount mysql_fdw local_schema -c username:password@host:port -o@- <<EOF
{
"dbname": "dbname",
"tables": ["table_1"]
}
EOF
This will mount a MySQL schema remote_schema
into a local schema
local_schema
on the sgr
engine. Note that if your MySQL server is running on
localhost and you wish to access it over a TCP connection, you should use
127.0.0.1
instead of localhost
as the host
.
"tables"
can be omitted (in which case all tables in remote_schema
will be
mounted into local_schema
).
You can also pass a dictionary of tables and their schema as tables
. This will
override the schema that's inferred by IMPORT FOREIGN SCHEMA
. For example:
{
"tables": {
"table_1": {
"schema": {
"col_1": "integer",
"col_2": "text"
}
}
}
}
To snapshot the table, making it part of an actual Splitgraph image, use the
sgr import
command.