-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table creation on read or write? #437
Comments
In the test environment the recommended way it to manually create all the missing tables with Dynamoid.included_models.each { |m| m.create_table(sync: true) } See https://github.com/Dynamoid/dynamoid#test-environment for details |
Are there plans to auto-create tables on reads in the future? |
I haven't considered this feature and have no strong opinion about it. Implicit table creation can be very confusing especially in production environment. Implicitness can make things more complex and difficult. On the other hand it's really handy in development and test environments. It seems reasonable to me to create tables implicitly at first "read" operation like |
We already have some degree of implicitness that comes with table creation on first writes. IMO, it makes things more complex and confusing with partial implicitness. |
Yeah, the PR is welcome. |
Hi team,
It seems like dynamoid is creating tables on the first write operation to that table but it doesn't do the same for the read operation. In our use case, it so happens that we have a
find_first_or_create
as the first operation in our rails appThat means we are going to be running into
Aws::DynamoDB::Errors::ResourceNotFoundException (Cannot do operations on a non-existent table)
everytime we add a new table with read operation first or everytime we run the build through CI (we use localstack to simulate our aws infrastructure in test).Is this by design? Is there a recommended way to handle this issue currently?
The text was updated successfully, but these errors were encountered: