|
1 | 1 | """FastAPI Users database adapter for AWS DynamoDB. |
2 | 2 |
|
3 | 3 | This adapter mirrors the SQLAlchemy adapter's public API and return types as closely |
4 | | -as reasonably possible while using DynamoDB via aiopynamodb. |
| 4 | +as reasonably possible while using DynamoDB via `aiopynamodb`. |
5 | 5 |
|
6 | 6 | Usage notes: |
7 | 7 | - This adapter is expected to function correctly, but it is still advisable to exercise |
8 | 8 | caution in production environments (yet). |
9 | | -- This will create non existent tables by default. You can tweak the creation inside generics.py |
10 | | -- This will require ON-DEMAND mode, since traffic is unpredictable in all auth tables! |
| 9 | +- The Database will create non existent tables by default. You can customize the configuration |
| 10 | + inside `config.py` using the `get` and `set` methods. |
| 11 | +- For now, tables will require ON-DEMAND mode, since traffic is unpredictable in all auth tables! |
11 | 12 | """ |
12 | 13 |
|
13 | 14 | import uuid |
|
23 | 24 | from . import config |
24 | 25 | from ._generics import UUID_ID |
25 | 26 | from .attributes import GUID, TransformingUnicodeAttribute |
| 27 | +from .config import __version__ # noqa: F401 |
26 | 28 | from .tables import ensure_tables_exist |
27 | 29 |
|
28 | | -__version__: str = "1.0.0" |
29 | | - |
30 | 30 |
|
31 | 31 | class DynamoDBBaseUserTable(Model, Generic[ID]): |
32 | 32 | """Base user table schema for DynamoDB.""" |
@@ -252,10 +252,10 @@ async def add_oauth_account(self, user: UP, create_dict: dict[str, Any]) -> UP: |
252 | 252 | except PutError as e: |
253 | 253 | if e.cause_response_code == "ConditionalCheckFailedException": |
254 | 254 | raise ValueError( |
255 | | - "OAuth account could not be updated because it already exists." |
| 255 | + "OAuth account could not be added because it already exists." |
256 | 256 | ) from e |
257 | 257 | raise ValueError( |
258 | | - "OAuth account could not be updated because the table does not exist." |
| 258 | + "OAuth account could not be added because the table does not exist." |
259 | 259 | ) from e |
260 | 260 |
|
261 | 261 | return user |
|
0 commit comments