|
| 1 | + |
| 2 | +API |
| 3 | +=== |
| 4 | + |
| 5 | + |
| 6 | +*type* Client |
| 7 | +------------- |
| 8 | + |
| 9 | +Client is a connection pool and is safe for concurrent use. |
| 10 | + |
| 11 | + |
| 12 | +.. code-block:: go |
| 13 | +
|
| 14 | + type Client = edgedb.Client |
| 15 | +
|
| 16 | +
|
| 17 | +*type* Error |
| 18 | +------------ |
| 19 | + |
| 20 | +Error is the error type returned from edgedb. |
| 21 | + |
| 22 | + |
| 23 | +.. code-block:: go |
| 24 | +
|
| 25 | + type Error = edgedb.Error |
| 26 | +
|
| 27 | +
|
| 28 | +*type* ErrorCategory |
| 29 | +-------------------- |
| 30 | + |
| 31 | +ErrorCategory values represent EdgeDB's error types. |
| 32 | + |
| 33 | + |
| 34 | +.. code-block:: go |
| 35 | +
|
| 36 | + type ErrorCategory = edgedb.ErrorCategory |
| 37 | +
|
| 38 | +
|
| 39 | +*type* ErrorTag |
| 40 | +--------------- |
| 41 | + |
| 42 | +ErrorTag is the argument type to Error.HasTag(). |
| 43 | + |
| 44 | + |
| 45 | +.. code-block:: go |
| 46 | +
|
| 47 | + type ErrorTag = edgedb.ErrorTag |
| 48 | +
|
| 49 | +
|
| 50 | +*type* Executor |
| 51 | +--------------- |
| 52 | + |
| 53 | +Executor is a common interface between \*Client and \*Tx, |
| 54 | +that can run queries on an EdgeDB database. |
| 55 | + |
| 56 | + |
| 57 | +.. code-block:: go |
| 58 | +
|
| 59 | + type Executor = edgedb.Executor |
| 60 | +
|
| 61 | +
|
| 62 | +*type* IsolationLevel |
| 63 | +--------------------- |
| 64 | + |
| 65 | +IsolationLevel documentation can be found here |
| 66 | +`docs/reference/edgeql/tx_start#parameters <https://www.edgedb.com/docs/reference/edgeql/tx_start#parameters>`_ |
| 67 | + |
| 68 | + |
| 69 | +.. code-block:: go |
| 70 | +
|
| 71 | + type IsolationLevel = edgedb.IsolationLevel |
| 72 | +
|
| 73 | +
|
| 74 | +*type* ModuleAlias |
| 75 | +------------------ |
| 76 | + |
| 77 | +ModuleAlias is an alias name and module name pair. |
| 78 | + |
| 79 | + |
| 80 | +.. code-block:: go |
| 81 | +
|
| 82 | + type ModuleAlias = edgedb.ModuleAlias |
| 83 | +
|
| 84 | +
|
| 85 | +*type* Options |
| 86 | +-------------- |
| 87 | + |
| 88 | +Options for connecting to an EdgeDB server |
| 89 | + |
| 90 | + |
| 91 | +.. code-block:: go |
| 92 | +
|
| 93 | + type Options = edgedb.Options |
| 94 | +
|
| 95 | +
|
| 96 | +*type* RetryBackoff |
| 97 | +------------------- |
| 98 | + |
| 99 | +RetryBackoff returns the duration to wait after the nth attempt |
| 100 | +before making the next attempt when retrying a transaction. |
| 101 | + |
| 102 | + |
| 103 | +.. code-block:: go |
| 104 | +
|
| 105 | + type RetryBackoff = edgedb.RetryBackoff |
| 106 | +
|
| 107 | +
|
| 108 | +*type* RetryCondition |
| 109 | +--------------------- |
| 110 | + |
| 111 | +RetryCondition represents scenarios that can cause a transaction |
| 112 | +run in Tx() methods to be retried. |
| 113 | + |
| 114 | + |
| 115 | +.. code-block:: go |
| 116 | +
|
| 117 | + type RetryCondition = edgedb.RetryCondition |
| 118 | +
|
| 119 | +
|
| 120 | +*type* RetryOptions |
| 121 | +------------------- |
| 122 | + |
| 123 | +RetryOptions configures how Tx() retries failed transactions. Use |
| 124 | +NewRetryOptions to get a default RetryOptions value instead of creating one |
| 125 | +yourself. |
| 126 | + |
| 127 | + |
| 128 | +.. code-block:: go |
| 129 | +
|
| 130 | + type RetryOptions = edgedb.RetryOptions |
| 131 | +
|
| 132 | +
|
| 133 | +*type* RetryRule |
| 134 | +---------------- |
| 135 | + |
| 136 | +RetryRule determines how transactions should be retried when run in Tx() |
| 137 | +methods. See Client.Tx() for details. |
| 138 | + |
| 139 | + |
| 140 | +.. code-block:: go |
| 141 | +
|
| 142 | + type RetryRule = edgedb.RetryRule |
| 143 | +
|
| 144 | +
|
| 145 | +*type* TLSOptions |
| 146 | +----------------- |
| 147 | + |
| 148 | +TLSOptions contains the parameters needed to configure TLS on EdgeDB |
| 149 | +server connections. |
| 150 | + |
| 151 | + |
| 152 | +.. code-block:: go |
| 153 | +
|
| 154 | + type TLSOptions = edgedb.TLSOptions |
| 155 | +
|
| 156 | +
|
| 157 | +*type* TLSSecurityMode |
| 158 | +---------------------- |
| 159 | + |
| 160 | +TLSSecurityMode specifies how strict TLS validation is. |
| 161 | + |
| 162 | + |
| 163 | +.. code-block:: go |
| 164 | +
|
| 165 | + type TLSSecurityMode = edgedb.TLSSecurityMode |
| 166 | +
|
| 167 | +
|
| 168 | +*type* Tx |
| 169 | +--------- |
| 170 | + |
| 171 | +Tx is a transaction. Use Client.Tx() to get a transaction. |
| 172 | + |
| 173 | + |
| 174 | +.. code-block:: go |
| 175 | +
|
| 176 | + type Tx = edgedb.Tx |
| 177 | +
|
| 178 | +
|
| 179 | +*type* TxBlock |
| 180 | +-------------- |
| 181 | + |
| 182 | +TxBlock is work to be done in a transaction. |
| 183 | + |
| 184 | + |
| 185 | +.. code-block:: go |
| 186 | +
|
| 187 | + type TxBlock = edgedb.TxBlock |
| 188 | +
|
| 189 | +
|
| 190 | +*type* TxOptions |
| 191 | +---------------- |
| 192 | + |
| 193 | +TxOptions configures how transactions behave. |
| 194 | + |
| 195 | + |
| 196 | +.. code-block:: go |
| 197 | +
|
| 198 | + type TxOptions = edgedb.TxOptions |
| 199 | +
|
| 200 | +
|
| 201 | +*type* WarningHandler |
| 202 | +--------------------- |
| 203 | + |
| 204 | +WarningHandler takes a slice of edgedb.Error that represent warnings and |
| 205 | +optionally returns an error. This can be used to log warnings, increment |
| 206 | +metrics, promote warnings to errors by returning them etc. |
| 207 | + |
| 208 | + |
| 209 | +.. code-block:: go |
| 210 | +
|
| 211 | + type WarningHandler = edgedb.WarningHandler |
0 commit comments