tiny_tds | fast FreeTDS bindings for Ruby using DB | SQL Database library

 by   rails-sqlserver Ruby Version: Current License: Non-SPDX

kandi X-RAY | tiny_tds Summary

kandi X-RAY | tiny_tds Summary

tiny_tds is a Ruby library typically used in Database, SQL Database applications. tiny_tds has no bugs, it has no vulnerabilities and it has low support. However tiny_tds has a Non-SPDX License. You can download it from GitHub.

The TinyTDS gem is meant to serve the extremely common use-case of connecting, querying and iterating over results to Microsoft SQL Server or Sybase databases from Ruby using the FreeTDS's DB-Library API. TinyTDS offers automatic casting to Ruby primitives along with proper encoding support. It converts all SQL Server datatypes to native Ruby primitives while supporting :utc or :local time zones for time-like types. To date it is the only Ruby client library that allows client encoding options, defaulting to UTF-8, while connecting to SQL Server. It also properly encodes all string and binary data. The motivation for TinyTDS is to become the de-facto low level connection mode for the SQL Server Adapter for ActiveRecord.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              tiny_tds has a low active ecosystem.
              It has 575 star(s) with 177 fork(s). There are 43 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 37 open issues and 339 have been closed. On average issues are closed in 133 days. There are 7 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of tiny_tds is current.

            kandi-Quality Quality

              tiny_tds has 0 bugs and 15 code smells.

            kandi-Security Security

              tiny_tds has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              tiny_tds code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              tiny_tds has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              tiny_tds releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.
              tiny_tds saves you 996 person hours of effort in developing the same functionality from scratch.
              It has 2264 lines of code, 76 functions and 22 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed tiny_tds and discovered the below as its top functions. This is intended to give you an instant insight into tiny_tds implemented functionality, and help decide if they suit your requirements.
            • Returns the executable path for the platform
            • Parses a host .
            • Try to find an executable path in the executable directory
            • Returns true if the file is binary .
            • Runs the command .
            • Creates a new build directory for the given build directory .
            • Install directories .
            • Set all patches for the patch
            Get all kandi verified functions for this library.

            tiny_tds Key Features

            No Key Features are available at this moment for tiny_tds.

            tiny_tds Examples and Code Snippets

            No Code Snippets are available at this moment for tiny_tds.

            Community Discussions

            QUESTION

            TinyTds::Error: Server name not found in configuration files
            Asked 2019-Oct-30 at 19:16

            I am using Docker + Rails + Tiny TDS on Windows. This configuration worked great until I started dockerizing the environment. Any help is much appreciated.

            Gemfile

            ...

            ANSWER

            Answered 2019-Oct-30 at 19:16

            As per @lyzard-kyng comment on the question the IP address helped diagnose the issue. The DNS suffix properties were managed by windows. I had to add them to the server_name.

            Source https://stackoverflow.com/questions/58613701

            QUESTION

            Bundler: Could not local Gemfile
            Asked 2019-Sep-19 at 22:40

            I'm moving some ruby projects over to an Ubuntu machine, and am trying to install the dependencies.

            I've installed ruby-full and the bundler gem. When I move to the project directory and type bundle install I get the error Could not locate Gemfile

            I am in the correct directory, and the GemFile is there. If I ls the current directory, I see:

            ...

            ANSWER

            Answered 2019-Sep-19 at 22:40

            Rename GemFile to Gemfile, and also GemFile.lock to Gemfile.lock.

            Source https://stackoverflow.com/questions/58017597

            QUESTION

            Unable to install tiny_tds on mac
            Asked 2019-Aug-20 at 18:23

            I am trying to set up a new mac and have been unable to get tiny_tds to compile. I am running OSX Mojave (10.14.6) and have ruby 2.4.5 installed via asdf. When I try to bundle, installing tiny_tds fails and the logs show:

            ...

            ANSWER

            Answered 2019-Aug-20 at 08:54

            My guess is that you have old ruby. In your case you have ruby 2.4.5.

            From quick check of the source code I think you need to have ruby 2.6.0 or newer for the latest tiny_tds gem.

            Source https://stackoverflow.com/questions/57348821

            QUESTION

            Capybara Upgrade Capybara::Query
            Asked 2019-Apr-03 at 15:14

            I have an old project with Capybara version 2.7.1. One file has the following code

            ...

            ANSWER

            Answered 2019-Apr-03 at 15:14

            It looks like your all method was just trying to add waiting behavior to the Capybara built-in all method (and doing it in a very strange way that would break the flexibility of selector types too). That became the default behavior in Capybara 3 anyway, so I'd recommend just removing your all monkeypatch.

            Source https://stackoverflow.com/questions/55492489

            QUESTION

            Passing data between SQL queries and separate Ruby file
            Asked 2019-Jan-19 at 08:09

            I'm using tiny_tds to pull data from a few different databases. As of right now, I have a Ruby file with multiple methods, each one devoted to a specific query (since the databases are very large, and not all of the scripts I'm using require the same kind/amount of data). To make things cleaner and easier, I wanted to separate out the SQL queries themselves into a single file, rather than have them embedded into the Ruby file containing the functions. But the SQL queries depend on certain fields having specific values. In essence, what I'm trying to do is send a variable to the SQL query, get data based on that particular value in a field, and feed that data back into the Ruby file.

            So a simplified version of what I'm currently doing is this:

            ...

            ANSWER

            Answered 2019-Jan-19 at 08:09

            You can use format method to replace placeholders with actual values. Here is the simplest example:

            Source https://stackoverflow.com/questions/54262261

            QUESTION

            Cannot establish an ActiveRecord connection in my ruby script
            Asked 2018-Aug-24 at 17:26

            I'm attempting to establish an Active Record connection with my ruby script and I keep getting the following error:

            ...

            ANSWER

            Answered 2018-Aug-24 at 17:26

            Probably, you must install activerecord-sqlserver-adapter as our friend says. By default, ruby on rails come with sqlite. Try install rubymine IDE, it will help you configure a database using an interface. Look at below:

            Configuration screen

            Source https://stackoverflow.com/questions/52005801

            QUESTION

            Rails 5.1 Running System Tests on Puma?
            Asked 2017-Oct-17 at 17:26

            I was wondering if there was a way to use the Puma server (Rails default) JUST on the new Rails 5.1 system tests?

            Right now on all our projects we use tiny_tds, but I was trying to experiment with 5.1 system tests with Capybara/Selenium but it fails of course because I do not have Puma installed/running.

            I took a look through the documentation and didn't see anything about declaring what type of server you want to use. Were connecting to a SQL Server database so I don't know if Puma is able to do that (And that's probably why were using tiny_tds in the first place).

            ...

            ANSWER

            Answered 2017-Oct-17 at 17:26

            You're confusing database adapters and rack web servers which are very different things.

            Puma (like Webrick, Thin, Unicorn etc) is a general purpose Rack web server. It sits and waits for incoming requests from vistors and dispatches them to an application (like a Rails app) by calling it with a hash containing the environment and request. The application returns an array containing the response. The server sends it back to the visitor.

            tiny_tds on the other hand is a database adapter. Its used to connect the application to the database. The web server is almost completly oblivious to how the application creates a response from the request. This includes whatever databases are used.

            In Rails 5 most servers don't require configuration. You just add the gem to the gemfile and run bundle install and they plug themselves in. There in no seperate installation step.

            That was not the case earlier which is why Webrick - a server with the only real merit being that it does not require configuration was the default. It is now Puma which unlike Webrick is suited for production.

            Using different servers in different environments is not a good idea since it violates the idea of dev/prod parity. Your dev & test environment should be as close as possible to what you are deploying to so that you can catch bugs before they end up in production. This means you should be running the same server, same database etc.

            Running a seperate test server for different parts of your test suite sounds like a true fools errand - if its even possible without hacking the framework to bits.

            For SQL Server there is activerecord-sqlserver-adapter which can use tiny_tds as a backend.

            Source https://stackoverflow.com/questions/46794120

            QUESTION

            Error Loading tiny_tds in CentOS 7
            Asked 2017-Sep-12 at 12:34

            I'm trying to use the tiny_tds to connect to a MS SQL with Dashing widget. I run into below error when trying to start my job.

            /root/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/thin-1.6.4/lib/thin/server.rb:107: warning: constant ::Fixnum is deprecated bundler: failed to load command: thin (/root/.rbenv/versions/2.4.1/bin/thin) LoadError: cannot load such file -- tiny_tds

            The gem is already installed.

            [root@localhost todo]# gem list | grep tiny_tds tiny_tds (2.0.0)

            [root@localhost todo]# tsql -C [TinyTds][v2.0.0][tsql]: /usr/bin/tsql Compile-time settings (established with the "configure" script) Version: freetds v0.95.81 freetds.conf directory: /etc MS db-lib source compatibility: yes Sybase binary compatibility: yes Thread safety: yes iconv library: yes TDS version: 4.2 iODBC: no unixodbc: yes SSPI "trusted" logins: no Kerberos: yes OpenSSL: no GnuTLS: yes

            [root@localhost todo]# yum list freetds* Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: ftp.iitm.ac.in * epel: epel.mirror.angkasa.id * extras: ftp.iitm.ac.in * updates: ftp.iitm.ac.in Installed Packages freetds.x86_64
            0.95.81-1.el7 @epel freetds-devel.x86_64
            0.95.81-1.el7 @epel Available Packages freetds-doc.noarch
            0.95.81-1.el7 epel [root@localhost todo]#

            I don't have much experience working with Ruby so please let me know if you need further information.

            ...

            ANSWER

            Answered 2017-Sep-12 at 12:34

            It looks like your job is running with bundler, which means it will look in Gemfile.lock to find the version. Even if it's installed on your OS, it won't work if it's not in the Gemfile.

            Therefore, ensure it's specified in the Gemfile, run bundle, and try again.

            Source https://stackoverflow.com/questions/46175446

            QUESTION

            in rails 5 can I connect Microsoft sql server 2008?
            Asked 2017-Jul-20 at 10:40

            Can I connect Microsoft SQLserver2008 in Rails 5? after installing the following gems:

            while running rails s, I am getting this error:

            C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/tiny_tds-2.0.0-x86-mingw32/lib/tiny_tds.rb:26:in require': cannot load such file -- tiny_tds/tiny_tds (LoadError)
            from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/tiny_tds-2.0.0
            -x86-mingw32/lib/tiny_tds.rb:26:in
            rescue in '
            from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/tiny_tds-2.0.0
            -x86-mingw32/lib/tiny_tds.rb:29:in `'

            ...

            ANSWER

            Answered 2017-Jul-20 at 10:18

            In the very beginning I was thinking that your problem was related to the availability of the gem for your current ruby version (something like this issue on GitHub).

            Digging into the documentation of the gem, in order to install on win you should run rake gem:windows first:

            Compiling Gems for Windows

            For the convenience of Windows users, TinyTDS ships pre-compiled gems for Ruby 2.0, 2.1, 2.2, and 2.3 on Windows. In order to generate these gems, rake-compiler-dock is used. This project provides a Docker image with rvm, cross-compilers and a number of different target versions of Ruby.

            Run the following rake task to compile the gems for Windows. This will check the availability of Docker (and boot2docker on Windows or OS-X) and will give some advice for download and installation. When docker is running, it will download the docker image (once-only) and start the build:

            $ rake gem:windows

            Source https://stackoverflow.com/questions/45208659

            QUESTION

            convert database of ruby on rails app from sql server to mysql
            Asked 2017-Mar-20 at 07:50

            i had clone a ruby on rails app with sql server, with some code like :

            ...

            ANSWER

            Answered 2017-Mar-20 at 07:24

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install tiny_tds

            Installing with rubygems should just work. TinyTDS is currently tested on Ruby version 2.0.0 and upward. If you use Windows, we pre-compile TinyTDS with static versions of FreeTDS and supporting libraries. If you're using RubyInstaller the binary gem will require that devkit is installed and in your path to operate properly. On all other platforms, we will find these dependencies. It is recommended that you install the latest FreeTDS via your method of choice. For example, here is how to install FreeTDS on Ubuntu. You might also need the build-essential and possibly the libc6-dev packages.
            Optionally, Microsoft has done a great job writing some articles on how to get started with SQL Server and Ruby using TinyTDS. Please checkout one of the following posts that match your platform.
            SQL Server on a Mac
            SQL Server on RHEL
            SQL Server on Ubuntu

            Support

            This is possible using FreeTDS version 0.95 or higher. You must use the use_utf16 login option or add the following config to your freetds.conf in either the global section or a specfic dataserver. If you are on Windows, the default location for your conf file will be in C:\Sites. The default is true and since FreeTDS v1.0 would do this as well.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/rails-sqlserver/tiny_tds.git

          • CLI

            gh repo clone rails-sqlserver/tiny_tds

          • sshUrl

            git@github.com:rails-sqlserver/tiny_tds.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link