Git Product home page Git Product logo

activerecord-jdbcsqlserver-adapter's Introduction

JRuby - an implementation of the Ruby language on the JVM

Master: JRuby CI, JRuby CI (Windows) 9.3 branch: JRuby CI, JRuby CI (Windows)

About

JRuby is an implementation of the Ruby language using the JVM.

It aims to be a complete, correct and fast implementation of Ruby, at the same time as providing powerful new features such as concurrency without a global-interpreter-lock, true parallelism, and tight integration to the Java language to allow you to use Java classes in your Ruby program and to allow JRuby to be embedded into a Java application.

You can use JRuby simply as a faster version of Ruby, you can use it to run Ruby on the JVM and access powerful JVM libraries such as highly tuned concurrency primitives, you can use it to embed Ruby as a scripting language in your Java program, or many other possibilities.

We're a welcoming community - you can talk to us on #jruby on Libera. There are core team members in the EU and US time zones.

Visit the JRuby website and the JRuby wiki for more information.

Getting JRuby

To run JRuby you will need a JRE (the Java VM runtime environment) version 8 or higher.

Your operating system may provide a JRE and JRuby in a package manager, but you may find that this version is very old.

An alternative is to use one of the Ruby version managers.

For rbenv you will need the ruby-build plugin. You may find that your system package manager can provide these. To see which versions of JRuby are available you should run:

$ rbenv install jruby

Note: if you do not regularly git update rbenv this list of versions may be out of date.

We recommend always selecting the latest version of JRuby from the list. You can install that particular version (9.2.13.0 is just for illustration):

$ rbenv install jruby-9.2.13.0

For rvm you can simply do:

$ rvm install jruby

Using Homebrew works too:

$ brew install jruby

You can also download packages from the JRuby website that you can unpack and run in place.

Building JRuby

See BUILDING for information about prerequisites, how to compile JRuby from source and how to test it.

Authors

Stefan Matthias Aust, Anders Bengtsson, Geert Bevin, Ola Bini, Piergiuliano Bossi, Johannes Brodwall, Rocky Burt, Paul Butcher, Benoit Cerrina, Wyss Clemens, David Corbin, Benoit Daloze, Thomas E Enebo, Robert Feldt, Chad Fowler, Russ Freeman, Joey Gibson, Kiel Hodges, Xandy Johnson, Kelvin Liu, Kevin Menard, Alan Moore, Akinori Musha, Charles Nutter, Takashi Okamoto, Jan Arne Petersen, Tobias Reif, David Saff, Subramanya Sastry, Chris Seaton, Nick Sieger, Ed Sinjiashvili, Vladimir Sizikov, Daiki Ueno, Matthias Veit, Jason Voegele, Sergey Yevtushenko, Robert Yokota, and many gracious contributors from the community.

JRuby uses code generously shared by the creator of the Ruby language, Yukihiro Matsumoto [email protected].

Project Contact: Thomas E Enebo [email protected]

License

JRuby is licensed under a tri EPL/GPL/LGPL license. You can use it, redistribute it and/or modify it under the terms of the:

Eclipse Public License version 2.0 OR GNU General Public License version 2 OR GNU Lesser General Public License version 2.1

Some components have other licenses and copyright. See the COPYING file for more specifics.

activerecord-jdbcsqlserver-adapter's People

Contributors

adzap avatar aharpervc avatar aidanharan avatar altonymous avatar annaswims avatar cjheath avatar coderjoe avatar h-lame avatar iaddict avatar jrafanie avatar koppen avatar kunitoo avatar marceloeloelo avatar matthewdunbar avatar mdotterer avatar metaskills avatar michelgrootjans avatar mtcmorris avatar nerdrew avatar rapofran avatar raydog153 avatar rhuanbarreto avatar snowblink avatar takanamito avatar tenderlove avatar thirdshift avatar vegantech avatar wbond avatar wpolicarpo avatar x1ting avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

activerecord-jdbcsqlserver-adapter's Issues

use of activerecord-jdbcsqlserver-adapter with jruby and Rails-6

Hi All,

I am using activerecord-jdbcsqlserver-adapter with Rails-5.2.8.1 on jruby-9.3.14 and want to upgradde to Rails-6.
Unfortunately, there is no version of activerecord-jdbcsqlserver-addapter supporting Rails-6.

Why is the activerecord-jdbcsqlserver-adapter not supported anymore?
Is there any chance of further support?

activerecord-sqlserver-adapter is still supported, but no option for me because of jruby (I guess).

Thanks in advance!

no such file to load -- pry

Hi ๐Ÿ‘‹ upgrading to Rails 5 here; squashed a lot of bugs to get a successful WAR file built, and upon deployment I'm seeing this Internal Server Error page with message You're seeing this error because you use JRuby::Rack::ErrorApp::ShowStatus.. Stack trace formatted below.

The thing is, pry in my Gemfile is in the development and test group, so I'm not sure why it's being loaded in the first place, or what specifically inside jdbc_overrides.rb is requiring pry (because that's the next-to-last line on top before the "no such file" statement). I did some source diving to see what the problem could be, but no luck.

I'm using JRuby 9.2.9.0, Bundler 1.17.3, and Warbler 2.0.5. If it's not a jdbcsqlserver issue, my next guess is Warbler, or maybe there's another knob I need to turn in my own configuration. I'll start going thru Warbler docs in depth, but in the meantime, does this look like a bug inside jdbc_overrides.rb by chance?

no such file to load -- pry 
from org/jruby/RubyKernel.java:978:in `require' 
from /edsa/app/webapps/ROOT/WEB-INF/gems/gems/activerecord-jdbcsqlserver-adapter-51.0.0/lib/active_record/connection_adapters/sqlserver/jdbc_overrides.rb:1:in `<main>' 
from org/jruby/RubyKernel.java:978:in `require' 
from /edsa/app/webapps/ROOT/WEB-INF/gems/gems/activerecord-jdbcsqlserver-adapter-51.0.0/lib/activerecord-jdbcsqlserver-adapter.rb:16:in `<main>' 
from org/jruby/RubyKernel.java:978:in `require' 
from /edsa/app/webapps/ROOT/WEB-INF/gems/gems/bundler-1.17.3/lib/bundler/runtime.rb:81:in `block in require' 
from org/jruby/RubyArray.java:1814:in `each' 
from /edsa/app/webapps/ROOT/WEB-INF/gems/gems/bundler-1.17.3/lib/bundler/runtime.rb:76:in `block in require' 
from org/jruby/RubyArray.java:1814:in `each' 
from /edsa/app/webapps/ROOT/WEB-INF/gems/gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `require' 
from /edsa/app/webapps/ROOT/WEB-INF/gems/gems/bundler-1.17.3/lib/bundler.rb:114:in `require' 
from /edsa/app/webapps/ROOT/WEB-INF/config/application.rb:7:in `<main>' 
from org/jruby/RubyKernel.java:978:in `require' 
from org/jruby/RubyKernel.java:1006:in `require_relative' 
from /edsa/app/webapps/ROOT/WEB-INF/config/environment.rb:2:in `<main>' 
from org/jruby/RubyKernel.java:978:in `require' 
from uri:classloader:/jruby/rack/rails/environment3.rb:25:in `load_environment' 
from uri:classloader:/jruby/rack/rails_booter.rb:83:in `load_environment' from <script>:1:in `<main>'

Issue w/ TinyTDS

Hi, trying to make the switch from an old SQL Server adapter here but I might be missing something, I can install the gem okay then create a WAR but as soon as I want to make a request upon booting my app it says it lacks the "tiny_tds" gem which obviously depends on C libs so can't really install it and put it in my package. Am I missing something ?

ActiveRecord::StatementInvalid Incorrect Syntax SQL Server 2012

Hi ๐Ÿ‘‹ I need to determine if what I'm seeing is a problem with how I've configured to use this adapter. Upgrading JRuby/Rails 4 to 5, and getting exceptions running queries in rails console. Here's a taste of what I'm seeing, and the configs I'm using. I'm happy to dive in if there's any bugs that need squashing, but it feels like I just don't have something configured correctly.

not recognizing attribute assignment

> u = User.new
#<User:0x4fa0ee7e> {}
=> nil
> u.first_name = 'Aaron'
Traceback (most recent call last):
        1: from (irb):8:in `evaluate'
NoMethodError (undefined method `first_name=' for #<User >)

User.first fails, but works with order clause (and only returns object notation)

> User.first
  User Load (8.0ms)  SELECT  [users].* FROM [users] OFFSET 0 ROWS FETCH NEXT ? ROWS ONLY  [["LIMIT", 1]]
Traceback (most recent call last):
        1: from (irb):15:in `evaluate'
ActiveRecord::StatementInvalid (ActiveRecord::JDBCError: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '0'.: SELECT  [users].* FROM [users] OFFSET 0 ROWS FETCH NEXT ? ROWS ONLY)

> User.order(id: :asc).first
  User Load (8.0ms)  SELECT  [users].* FROM [users]  ORDER BY [users].[id] ASC OFFSET 0 ROWS FETCH NEXT ? ROWS ONLY  [["LIMIT", 1]]
=> #<User >

using awesome_print gem returns weird typed object notation with String

> ap User.order(id: :asc).first
  User Load (6.0ms)  SELECT  [users].* FROM [users]  ORDER BY [users].[id] ASC OFFSET 0 ROWS FETCH NEXT ? ROWS ONLY  [["LIMIT", 1]]
#<User:0x15e8c040> {
               "id"String1,
       "first_name"String"Aaron",
       "created_at"String2018-10-30 06:55:11 UTC,
       "updated_at"String2019-07-11 16:54:22 UTC
}

joins query reports unknown primary key

> User.joins(:user_roles)
Traceback (most recent call last):
ActiveRecord::UnknownPrimaryKey (Unknown primary key for table users in model User.)

raw sql appears to work fine

> ActiveRecord::Base.connection.execute("SELECT @@VERSION")
   (2.0ms)  SELECT @@VERSION
=> #<ActiveRecord::Result:0x75dd0f94 @rows=[["Microsoft SQL Server 2012 (SP4-GDR) (KB4057116) - 11.0.7462.6 (X64) \n\tJan  5 2018 22:11:56 \n\tCopyright (c) Microsoft Corporation\n\tDeveloper Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)\n"]], @hash_rows=nil, @columns=[""], @column_types={}>

> ActiveRecord::Base.connection.execute("SELECT COUNT(*) FROM USERS;")
   (8.0ms)  SELECT COUNT(*) FROM USERS;
=> #<ActiveRecord::Result:0x54bb1194 @rows=[[100]], @hash_rows=nil, @columns=[""], @column_types={}>

Gemfile

gem 'rails', '~> 5.1.0'
gem 'activerecord'
gem 'activerecord-jdbcsqlserver-adapter', '~> 51.0'

database.yml

development:
  adapter: sqlserver
  driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
  database: <%= ENV['database'] %>
  schema: dbo
  url: <%= ENV['url'] %>
  username: <%= ENV['username'] %>
  password: <%= ENV['password'] %>
  pool: 200

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.