postgres¶
Strategy class for application/vnd.postgresql
PostgresConfig
¶
Bases: AttrDict
Configuration data model for
PostgresResourceStrategy
.
Source code in oteapi/strategies/parse/postgres.py
13 14 15 16 17 18 19 20 21 22 |
|
PostgresResourceConfig
¶
Bases: ResourceConfig
Postgresql parse strategy config
Source code in oteapi/strategies/parse/postgres.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
adjust_url(values)
¶
Root Validator Verifies configuration consistency, merge configurations and update the accessUrl property.
Source code in oteapi/strategies/parse/postgres.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
PostgresResourceStrategy
¶
Resource strategy for Postgres.
Registers strategies:
("accessService", "postgres")
Purpose of this strategy: Connect to a postgres DB and run a SQL query on the dbname to return all relevant rows.
Source code in oteapi/strategies/parse/postgres.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
get(session=None)
¶
Resource Postgres query responses.
Source code in oteapi/strategies/parse/postgres.py
158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
initialize(session=None)
¶
Initialize strategy.
Source code in oteapi/strategies/parse/postgres.py
154 155 156 |
|
SessionUpdatePostgresResource
¶
Bases: SessionUpdate
Configuration model for PostgresResource.
Source code in oteapi/strategies/parse/postgres.py
133 134 135 136 |
|
create_connection(resource_config)
¶
Create a dbname connection to Postgres dbname.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resource_config |
PostgresResourceConfig
|
A dictionary providing everything needed for a psycopg connection configuration |
required |
Raises:
Type | Description |
---|---|
Error
|
If a DB connection cannot be made. |
Returns:
Type | Description |
---|---|
Connection
|
Connection object. |
Source code in oteapi/strategies/parse/postgres.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|