Sha256: 165560a5d46417c607ae2236c1e1a60dce7d4d68eadbe3feec98b938096b78c9
Contents?: true
Size: 892 Bytes
Versions: 24
Compression:
Stored size: 892 Bytes
Contents
# Sample - Bulk Insert It is important to use the correct strategy when bulk creating new records in Spanner using ActiveRecord. ActiveRecord will by default create a separate insert statement for each entity that you create. The Spanner ActiveRecord adapter is able to translate this into a set of insert Mutations instead of a list of insert DML statements, which will execute a lot faster. There are two ways to achieve this: 1. Create a batch of entities without an explicit transaction. 2. Use a read/write transaction with isolation level `:buffered_mutations` See also the `Mutations` sample in this repository. The sample will automatically start a Spanner Emulator in a docker container and execute the sample against that emulator. The emulator will automatically be stopped when the application finishes. Run the application with the command ```bash bundle exec rake run ```
Version data entries
24 entries across 24 versions & 1 rubygems