Mkt281001
Mkt281001

Reputation: 275

Enforce fully qualified table name in Slick Query

How to enforce slick to add schema name in generated query so that it works with different db users.

I have two users one have all privileges while other is read only. I have granted select on user 1's tables to user 2.

But, on running query in Slick, encountered error ORA-00942: table or view does not exist.

Please suggest.

Upvotes: 3

Views: 424

Answers (1)

Mkt281001
Mkt281001

Reputation: 275

Figured it out. Table allows to pass schema name as given below

         abstract class Table[T](_tableTag: Tag, _schemaName: Option[String], _tableName: String) 

Example

            class InstrumentType(tag: Tag) extends 
                Table[String](tag,Some(SCHEMA_NAME), TableName)

Upvotes: 4

Related Questions