Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion splitgraph/commandline/push_pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def push_c(
tags,
):
"""
Push images the Splitgraph registry or another engine.
Push images to the Splitgraph registry or another engine.

If an image is not specified (e.g. `sgr push noaa/climate`, this will push all new images.

Expand Down
10 changes: 6 additions & 4 deletions splitgraph/hooks/data_source/fdw.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ def init_fdw(
wrapper: str,
server_options: Optional[Mapping[str, Optional[str]]] = None,
user_options: Optional[Mapping[str, str]] = None,
role: Optional[str] = None,
overwrite: bool = True,
) -> None:
"""
Expand All @@ -313,6 +314,7 @@ def init_fdw(
:param wrapper: Name of the foreign data wrapper (must be installed as an extension on the engine)
:param server_options: Dictionary of FDW options
:param user_options: Dictionary of user options
:param role: The name of the role for which the user mapping is created; defaults to public.
:param overwrite: If the server already exists, delete and recreate it.
"""
from psycopg2.sql import SQL, Identifier
Expand All @@ -332,8 +334,8 @@ def init_fdw(
engine.run_sql(create_server)

if user_options:
create_mapping = SQL("CREATE USER MAPPING IF NOT EXISTS FOR PUBLIC SERVER {}").format(
Identifier(server_id)
create_mapping = SQL("CREATE USER MAPPING IF NOT EXISTS FOR {} SERVER {}").format(
SQL("PUBLIC") if role is None else Identifier(role), Identifier(server_id)
)
user_keys, user_vals = zip(*user_options.items())
create_mapping += _format_options(user_keys)
Expand Down Expand Up @@ -528,8 +530,8 @@ class MongoDataSource(ForeignDataWrapperDataSource):
{
"table_name": {
"schema": {"col1": "type1"...},
"options": {"database": <dbname>, "collection": <collection>}
}
"options": {"database": <dbname>, "collection": <collection>}
}
}
```
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX idx_table_objects ON splitgraph_meta.tables USING GIN(object_ids);
6 changes: 3 additions & 3 deletions splitgraph/resources/static/splitgraph_api.sql
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ BEGIN
END
$$
LANGUAGE plpgsql
SECURITY DEFINER SET search_path = splitgraph_meta, pg_temp;
SECURITY DEFINER SET search_path = splitgraph_meta, pg_temp, public;

-- Delete image.
-- Note this doesn't delete references to the image, e.g. where
Expand Down Expand Up @@ -334,7 +334,7 @@ BEGIN
END
$$
LANGUAGE plpgsql
SECURITY DEFINER SET search_path = splitgraph_meta, pg_temp;
SECURITY DEFINER SET search_path = splitgraph_meta, pg_temp, public;

-- tag_image (namespace, repository, image_hash, tag)
CREATE OR REPLACE FUNCTION splitgraph_api.tag_image (
Expand Down Expand Up @@ -396,7 +396,7 @@ BEGIN
END
$$
LANGUAGE plpgsql
SECURITY DEFINER SET search_path = splitgraph_meta, pg_temp;
SECURITY DEFINER SET search_path = splitgraph_meta, pg_temp, public;

--
-- OBJECT API
Expand Down