776 def insert_permissive(table: SQL.Table, sql: SQL.Source = ""): SQL.Source = |
776 def insert_permissive(table: SQL.Table, sql: SQL.Source = ""): SQL.Source = |
777 table.insert_cmd(sql = if_proper(sql, sql + " ") + "ON CONFLICT DO NOTHING") |
777 table.insert_cmd(sql = if_proper(sql, sql + " ") + "ON CONFLICT DO NOTHING") |
778 |
778 |
779 |
779 |
780 /* explicit locking: only applicable to PostgreSQL within transaction context */ |
780 /* explicit locking: only applicable to PostgreSQL within transaction context */ |
781 // see https://www.postgresql.org/docs/current/sql-lock.html |
781 // see https://www.postgresql.org/docs/14/sql-lock.html |
782 // see https://www.postgresql.org/docs/current/explicit-locking.html |
782 // see https://www.postgresql.org/docs/14/explicit-locking.html |
783 |
783 |
784 override def lock_tables(tables: List[SQL.Table]): PostgreSQL.Source = |
784 override def lock_tables(tables: List[SQL.Table]): PostgreSQL.Source = |
785 if_proper(tables, "LOCK TABLE " + tables.mkString(", ") + " IN ACCESS EXCLUSIVE MODE") |
785 if_proper(tables, "LOCK TABLE " + tables.mkString(", ") + " IN ACCESS EXCLUSIVE MODE") |
786 |
786 |
787 |
787 |
788 /* notifications: IPC via database server */ |
788 /* notifications: IPC via database server */ |
789 /* |
789 /* |
790 - see https://www.postgresql.org/docs/current/sql-notify.html |
790 - see https://www.postgresql.org/docs/14/sql-notify.html |
791 - self-notifications and repeated notifications are suppressed |
791 - self-notifications and repeated notifications are suppressed |
792 - notifications are sorted by local system time (nano seconds) |
792 - notifications are sorted by local system time (nano seconds) |
793 */ |
793 */ |
794 |
794 |
795 private var _receiver_buffer: Option[Map[SQL.Notification, Long]] = None |
795 private var _receiver_buffer: Option[Map[SQL.Notification, Long]] = None |