Azure MS SQL Server - USE statement is not supported to switch between databases
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Use the Dockerfile dependency setup and fluent.conf as the reproduction context, then follow the reported ActiveRecord SQL Server and TinyTDS connection stack. Determine how the sql plugin passes the database setting to that connection and confirm the behavior against Azure MS SQL Server. Done means the configured database connection succeeds without the unsupported USE switch.
Written by the indexing model from the issue text.
Description
Hi,
I'm trying to use fluent-plugin-sql with Azure MS SQL Server DB and getting error.
Dockerfile partial config:
&& gem install fluent-plugin-sql --no-document \
&& gem install tiny_tds \
&& gem install activerecord-sqlserver-adapter \
fluent.conf
<match *>
@type sql
host ...
port 1433
database ...
adapter sqlserver
username ...
password ...
<table>
table ...
</table>
</match>
Error in fluentd logs:
2023-05-12 19:59:57 +0000 [warn]: #0 failed to flush the buffer. retry_times=0 next_retry_time=2023-05-12 19:59:58 +0000 chunk="5fb8489140af6d7034566d69be465982" error_class=TinyTds::Error error="USE statement is not supported to switch between databases. Use a new connection to connect to a different database."
2023-05-12 19:59:57 +0000 [warn]: #0 /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/gems/3.1.0/gems/tiny_tds-2.1.5/lib/tiny_tds/client.rb:60:in `connect'
2023-05-12 19:59:57 +0000 [warn]: #0 /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/gems/3.1.0/gems/tiny_tds-2.1.5/lib/tiny_tds/client.rb:60:in `initialize'
2023-05-12 19:59:57 +0000 [warn]: #0 /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/gems/3.1.0/gems/activerecord-sqlserver-adapter-7.0.2.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:90:in `new'
2023-05-12 19:59:57 +0000 [warn]: #0 /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/gems/3.1.0/gems/activerecord-sqlserver-adapter-7.0.2.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:90:in `dblib_connect'
2023-05-12 19:59:57 +0000 [warn]: #0 /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/gems/3.1.0/gems/activerecord-sqlserver-adapter-7.0.2.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:83:in `new_client'
2023-05-12 19:59:57 +0000 [warn]: #0 /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/gems/3.1.0/gems/activerecord-sqlserver-adapter-7.0.2.0/lib/active_record/sqlserver_base.rb:15:in `sqlserver_connection'
Looks like Azure SQL Server doesn't support USE command to switch database. Anyone faced and resolved this?
Thanks in advance.
- Dominant language
- Ruby
- Stars
- 112
- Forks
- 58
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fluent/fluent-plugin-sql
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
fluent/fluent-plugin-sql#151 · 1 comment ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
fluent/fluent-plugin-sql#149 ·
-
bug needs-investigation
Difficulty 3/5 1-2 days Newbie friendliness 48/100
fluent/fluent-plugin-sql#141 · 1 comment ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 42/100
fluent/fluent-plugin-sql#138 · 1 comment ·
-
fluent/fluent-plugin-sql#134 · 6 comments · 1 assignee ·
All issues in fluent/fluent-plugin-sql
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
palladius/rails8-app-on-gcp#145 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
rubocop/rubocop-rspec#2236 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
riscv/riscv-unified-db#2624 · 1 reaction ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100