tiny_tds | fast FreeTDS bindings for Ruby using DB | SQL Database library
kandi X-RAY | tiny_tds Summary
kandi X-RAY | tiny_tds Summary
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
Top functions reviewed by kandi - BETA
- 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
tiny_tds Key Features
tiny_tds Examples and Code Snippets
Community Discussions
Trending Discussions on tiny_tds
QUESTION
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:16As 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.
QUESTION
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:40Rename GemFile
to Gemfile
, and also GemFile.lock
to Gemfile.lock
.
QUESTION
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:54My 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.
QUESTION
I have an old project with Capybara version 2.7.1. One file has the following code
...ANSWER
Answered 2019-Apr-03 at 15:14It 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.
QUESTION
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:09You can use format
method to replace placeholders with actual values. Here is the simplest example:
QUESTION
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:26Probably, 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:
QUESTION
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:26You'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.
QUESTION
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:34It 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.
QUESTION
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)
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:26: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:18In 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 WindowsFor 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
QUESTION
i had clone a ruby on rails app with sql server
, with some code like :
ANSWER
Answered 2017-Mar-20 at 07:24Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tiny_tds
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
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page