Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    folks, re-iterating Eduardo's question above. Any help for installing this for ruby 2.6 ?
    Benjamin Fleischer
    we have it working on Ruby 2.6
    it works fine, no?
    on windows 10 ?
    so still cimplains
    I mean it still complains about being incompatible with ruby 2.6
    yassine ben gharsallah
    Hello guys i have some questions about an sql query could you help me ?
    Hi guys, does this gem work with jdbc as well, or do I have to use 'activerecord-jdbcmssql-adapter' instead?
    Rob Widmer
    Hi @podsi, It depends what version of active record you are using, if you are 4.2 or lower you can use the activerecord-jdbcmssql-adapter gem, 5 or above, we're hoping to have an activerecord-jdbcsqlserver-adapter gem released before rubyconf
    Hi @rdubya, thx for your fast response, we are using activerecord 5.2.3, so I am looking forward to the release!
    David McDonald
    I'm attempting to fix the failing tests on Master. I've gotten them resolved down to just 17 ActiveRecord errors. But I'm new to contributing to projects and alot of this is new to me. I'm getting a lot of messages like "Unfound coerced test: ActiveRecord::AdapterTest#test_select_all_with_legacy_binds" when running "rake test TEST=test/cases/coerced_tests.rb"
    I'm not sure quite how to interpret that
    Enrique González
    hi! i was able to run rails 6 with the github branch 6-0-dev. is there a reason that it is not being pushed to master?
    Titov Andrey

    H everyone:
    I'm experiencing below error altough database.yml stated database different from "master":

    "<username>" is not able to access the database "master" under the current security context

    Any ideas?

    Dale Glaser
    @Enrand22_twitter I would assume it's because there are still tests failing.
    Titov Andrey
    @idrozd upd: added azure: true / solved
    Joseph Haig
    Hi. We are possibly going to be moving some Rails apps to Azure and, as such, could start using an MS SQL server as the database. I have literally just starting playing around with this (thanks for this gem, by the way) and am trying it with a mcr.microsoft.com/mssql/server:2017-latest-ubuntu docker image. Our migrations are failing because at some points we are defining columns as 'bool' which, I see now, is not standard SQL. Is there a way to get the sqlserver adapter to automatically substitute for (presumably) a tiny int or a char?

    NoMethodError: undefined method `alias_method_chain' for #<Class:ActiveRecord::Base>
    Did you mean? alias_method

    i always get this error when i make db with sql server in rails

    Andrew Blignaut
    Hi All, I just recently a pull request to the repo but I see that the build is failing for most open pull requests. What's up? Is anyone actively getting the tests back up and running and reviewing pull requests? Thanks
    anyone got this thing running with rails 6 and ruby 2.7?
    anyone even reading this ? xD
    Andrew Blignaut
    @nemesit - No, we are running rails 5.2 at the moment.
    @AndrewBlignaut_twitter yeah we are too, shame really. do the 5.2 tests for this adapter all pass for you?
    I fixed all the ONLY_SQLSERVER=1 errors for rails 6 dunno bout the activerecord stuff
    Hey guys, I know this doesn't work with rails 6 - but do you know when it will be? Not exactly, i just wanna know is it like 2 months or 12 months amount of time
    @dlipinski it will be ready as soon as some has time to run all tests and fix the failing ones. Yoe are welcome to help in this matter ;-)
    Aidan Haran
    All the Rails 6 tests are now passing on Travis CI. Trying to fix the last of the tests failing on Windows (AppVeyor). After that is done then I think there will be a release candidate for Rails 6.
    Wanderson Policarpo
    I released the first RC for Rails 6 v6.0.0.rc1 now. I appreciate if you have a chance to test it and give any feedback or report issues here: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues
    anyone know why I am getting

    rails db:migrate:down VERSION=20200528104729 RAILS_ENV=development
    == 20200528104729 SomeMigration: reverting =====================================
    rails aborted!
    StandardError: An error has occurred, all later migrations canceled:

    undefined method `revert' for #<ActiveRecord::ConnectionAdapters::SQLServerAdapter:0x00007f7f271c3150>

    (5.2 not rails 6)
    and another thing is that it seems like disable_referential_integrity does not get called when testing
    I'm not sure but I think thats kinda necessary
    Aidan Haran
    @nemesit For the "rails db:migrate:down" issue can you create a reproducible script to demonstrate the issue? https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/How-to-report-a-bug
    @nemesit The tests are currently passing for Rails 5.2 and 6 so I'm not sure why "disable_referential_integrity" is necessary.
    maybe only occurs with multiple adapters
    that it only disables constraints on the main one and not all?
    I guess that could be the problem
    likely in rails itself
    Aidan Haran
    I don't think the current versions of the SQL Server adapter will work if you are using multiple database adapters in the same application. For example, the SQL Server adapter monkey-patches Arel. However, Arel is used by other adapters such as PostgreSQL/MySQL/etc and these monkey-patches will probably break those adapters.
    works fine here, except for the constraint in fixtures
    all tests succeed except when I add foreign keys to the db, because rails only disables the constraints for the main adapter (I guess)
    Michał Zając

    Hi, I'm getting Adaptive Server connection failed (localhost:1433) when trying to bin/rails db:migrate in my application. tsql -H localhost -p 1433 -U sa -P ais7Jighaich (I'm not using this in production) works just fine.

    My config/database.yml

    default: &default
      adapter: <%= ENV.fetch("DATABASE_ADAPTER", "postgresql") %>
      mode: dblib
      host: <%= ENV.fetch("DATABASE_HOST", "localhost") %>
      port: <%= ENV.fetch("DATABASE_PORT", 5432) %>
      pool: 5
      timeout: 5000
      user: <%= ENV.fetch("DATABASE_USER", "nbp") %>
      password: <%= ENV.fetch("SA_PASSWORD") { ENV.fetch("DATABASE_PASSWORD", "nbp") } %>
      <<: *default
      database: <%= ENV.fetch("DATABASE_NAME", "nbp") %>
      <<: *default
      database: <%= ENV.fetch("DATABASE_NAME", "nbp_development") %>
      <<: *default
      database: <%= ENV.fetch("DATABASE_NAME", "nbp_test") %>
      host: <%= ENV.fetch("DATABASE_HOST", "postgres") %>

    And yes, I have exported the variables

    quintasan@applover:~/source/applover/nbp_backend$ env | grep DATABASE

    What am I doing wrong?

    Michał Zając
    TinyTds can connect as well:
    [1] pry(main)> client = TinyTds::Client.new username: 'sa', password: 'ais7Jighaich', host: 'localhost', port: 1433
    [2] pry(main)> result = client.execute("SELECT GETDATE()")
    #<TinyTds::Result:0x000055952ff44100 @query_options={:as=>:hash, :symbolize_keys=>false, :cache_rows=>true, :timezone=>:local, :empty_sets=>true}>
    [3] pry(main)> result.each do |row|
    [3] pry(main)*   row.inspect  
    [3] pry(main)* end  
        [0] {
            "" => 2020-10-06 13:11:34 +0200
    Walther Diechmann
    hi - we're debugging a troubled SQL statement pulling 900K+ rows from a 2008 MSSQLServer using tiny_tds 2.1.3 gem in a Rails project - and lately we're experiencing TinyTds::Error: DBPROCESS is dead or not enabled errors - I know this is like nothing to comment on but perhaps one of you guys have seen this one before and got ideas on how to best debug the issue?
    Guyren Howe

    Hi. My organization (CoverMyMeds) is keen to fix issues with 6.0 and ensure 6.1 is great.

    I can't run tests atm (I created rails-sqlserver/activerecord-sqlserver-adapter#913 about it), but will help out as I'm able until that's fixed. I was planning to do code reviews, but feel free to speak up if I can help in some other way.

    Guyren Howe
    I see no reason not to fix the need for use_output_inserted: use introspection on the database to detect the relevant conditions (trigger on the table, and trigger on the table in the presence of UUID) to determine what means to use to return the newly inserted id. Am I missing something with this idea?
    Senol Feldmann
    Hi! I have a question about tiny_tds. Does anyone know if the the various exe files which are shipped in the fat binary gem version (mingw-x64 / CRuby on Windows) of tiny_tds are really needed for tiny_tds to operate?
    For me, iconv.exe in C:\Ruby27-x64\lib\ruby\gems\2.7.0\gems\tiny_tds-2.1.5-x64-mingw32\ports\x86_64-w64-mingw32\libiconv\1.15\bin is especially important, as it is licensed under GPL and I want to use activerecord-sqlserver-adapter (and thus tiny_tds as it is a dependency) use commercially.