(&self)
| 814 | |
| 815 | impl ExecuteResponse { |
| 816 | pub fn tag(&self) -> Option<String> { |
| 817 | use ExecuteResponse::*; |
| 818 | match self { |
| 819 | AlteredDefaultPrivileges => Some("ALTER DEFAULT PRIVILEGES".into()), |
| 820 | AlteredObject(o) => Some(format!("ALTER {}", o)), |
| 821 | AlteredRole => Some("ALTER ROLE".into()), |
| 822 | AlteredSystemConfiguration => Some("ALTER SYSTEM".into()), |
| 823 | ClosedCursor => Some("CLOSE CURSOR".into()), |
| 824 | Comment => Some("COMMENT".into()), |
| 825 | Copied(n) => Some(format!("COPY {}", n)), |
| 826 | CopyTo { .. } => None, |
| 827 | CopyFrom { .. } => None, |
| 828 | CreatedConnection { .. } => Some("CREATE CONNECTION".into()), |
| 829 | CreatedDatabase { .. } => Some("CREATE DATABASE".into()), |
| 830 | CreatedSchema { .. } => Some("CREATE SCHEMA".into()), |
| 831 | CreatedRole => Some("CREATE ROLE".into()), |
| 832 | CreatedCluster { .. } => Some("CREATE CLUSTER".into()), |
| 833 | CreatedClusterReplica { .. } => Some("CREATE CLUSTER REPLICA".into()), |
| 834 | CreatedIndex { .. } => Some("CREATE INDEX".into()), |
| 835 | CreatedSecret { .. } => Some("CREATE SECRET".into()), |
| 836 | CreatedSink { .. } => Some("CREATE SINK".into()), |
| 837 | CreatedSource { .. } => Some("CREATE SOURCE".into()), |
| 838 | CreatedTable { .. } => Some("CREATE TABLE".into()), |
| 839 | CreatedView { .. } => Some("CREATE VIEW".into()), |
| 840 | CreatedViews { .. } => Some("CREATE VIEWS".into()), |
| 841 | CreatedMaterializedView { .. } => Some("CREATE MATERIALIZED VIEW".into()), |
| 842 | CreatedType => Some("CREATE TYPE".into()), |
| 843 | CreatedNetworkPolicy => Some("CREATE NETWORKPOLICY".into()), |
| 844 | Deallocate { all } => Some(format!("DEALLOCATE{}", if *all { " ALL" } else { "" })), |
| 845 | DeclaredCursor => Some("DECLARE CURSOR".into()), |
| 846 | Deleted(n) => Some(format!("DELETE {}", n)), |
| 847 | DiscardedTemp => Some("DISCARD TEMP".into()), |
| 848 | DiscardedAll => Some("DISCARD ALL".into()), |
| 849 | DroppedObject(o) => Some(format!("DROP {o}")), |
| 850 | DroppedOwned => Some("DROP OWNED".into()), |
| 851 | EmptyQuery => None, |
| 852 | Fetch { .. } => None, |
| 853 | GrantedPrivilege => Some("GRANT".into()), |
| 854 | GrantedRole => Some("GRANT ROLE".into()), |
| 855 | Inserted(n) => { |
| 856 | // "On successful completion, an INSERT command returns a |
| 857 | // command tag of the form `INSERT <oid> <count>`." |
| 858 | // -- https://www.postgresql.org/docs/11/sql-insert.html |
| 859 | // |
| 860 | // OIDs are a PostgreSQL-specific historical quirk, but we |
| 861 | // can return a 0 OID to indicate that the table does not |
| 862 | // have OIDs. |
| 863 | Some(format!("INSERT 0 {}", n)) |
| 864 | } |
| 865 | Prepare => Some("PREPARE".into()), |
| 866 | Raised => Some("RAISE".into()), |
| 867 | ReassignOwned => Some("REASSIGN OWNED".into()), |
| 868 | RevokedPrivilege => Some("REVOKE".into()), |
| 869 | RevokedRole => Some("REVOKE ROLE".into()), |
| 870 | SendingRowsStreaming { .. } | SendingRowsImmediate { .. } => None, |
| 871 | SetVariable { reset: true, .. } => Some("RESET".into()), |
| 872 | SetVariable { reset: false, .. } => Some("SET".into()), |
| 873 | StartedTransaction { .. } => Some("BEGIN".into()), |
no outgoing calls
no test coverage detected