GRANT TO SHARE
Introduced or updated: v1.2.949
Data Sharing is an Enterprise Edition feature. Contact Databend Support for a license.
Grants a database or a table of the provider to a Share.
Syntax
GRANT USAGE ON DATABASE <database_name> TO SHARE <share_name>
GRANT SELECT ON TABLE [ <database_name>. ]<table_name> TO SHARE <share_name>
Only these two forms are supported. If you do not specify database_name, Databend uses the current database.
Usage Notes
- Grant
USAGEon the database first. Then grantSELECTon each table.USAGEalone does not give access to the tables. - A Share can grant one database only. The tables must be in this database.
- The Share must have a connection before you grant a table.
- The table must be a FUSE table without row access policies or masking policies.
- You cannot grant a shared database.
- If you rename a table, the grant stays. If you drop a table and create it again, grant the new table.
For the privileges, see Access Control.
Examples
GRANT USAGE ON DATABASE orders_db TO SHARE sales_share;
GRANT SELECT ON TABLE orders_db.orders TO SHARE sales_share;