Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ruby/rails/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ default: &default
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
username: <%= ENV.fetch("CLUSTER_USER") { "admin" } %>
host: <%= ENV['CLUSTER_ENDPOINT'] %>
# Disable prepared statements and advisory locks for Aurora DSQL
prepared_statements: false
# Disable advisory locks for Aurora DSQL

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: probably unnecessary comment

advisory_locks: false
sslnegotiation: direct
sslmode: verify-full
Expand Down
5 changes: 1 addition & 4 deletions ruby/rails/carrental/config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ test:
username: <%= ENV.fetch("CLUSTER_USER", "admin") %>
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
prepared_statements: false
advisory_locks: false
sslmode: verify-full
sslnegotiation: direct
Expand All @@ -41,11 +40,10 @@ test:
# Aurora DSQL requires:
# - IAM-based authentication (tokens generated per connection)
# - SSL with verify-full mode and direct negotiation
# - No prepared statements (not supported by DSQL)
# - No advisory locks (not supported by DSQL)
#
# The DSQL adapter initializer (config/initializers/dsql_adapter.rb)
# handles IAM token injection and disables unsupported features.
# handles IAM token injection and Active Record configuration.
# ---------------------------------------------------------------------------
production:
adapter: postgresql
Expand All @@ -56,7 +54,6 @@ production:
username: <%= ENV.fetch("DSQL_USER", "admin") %>
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
prepared_statements: false
advisory_locks: false
sslmode: verify-full
sslnegotiation: direct
Expand Down
4 changes: 4 additions & 0 deletions ruby/rails/carrental/test/models/vehicle_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def build_vehicle(overrides = {})
}.merge(overrides)
end

test "uses prepared statements" do
assert ActiveRecord::Base.connection.prepared_statements
end

test "creates a valid vehicle" do
vehicle = Vehicle.create!(build_vehicle)
assert vehicle.persisted?
Expand Down
3 changes: 1 addition & 2 deletions ruby/rails/petclinic/config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ default: &default
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
username: <%= ENV.fetch("CLUSTER_USER") { "admin" } %>
host: <%= ENV['CLUSTER_ENDPOINT'] %>
# Disable prepared statements and advisory locks for Aurora DSQL
prepared_statements: false
# Disable advisory locks for Aurora DSQL

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: probably unnecessary comment

advisory_locks: false
sslnegotiation: direct
sslmode: verify-full
Expand Down
4 changes: 4 additions & 0 deletions ruby/rails/petclinic/test/models/owner_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
require "test_helper"

class OwnerTest < ActiveSupport::TestCase
test "uses prepared statements" do
assert ActiveRecord::Base.connection.prepared_statements
end

test "upsert updates non-primary-key columns" do
owner = Owner.create!(name: "Original Name", city: "Seattle")

Expand Down
Loading