问题标签 [tiny-tds]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ruby - 使用 Modulo 找不到红宝石密钥
我正在尝试使用字符串的模函数%
来获取哈希并将其值注入字符串内的适当位置,但key{x} not found (KeyError)
即使我可以确认密钥在那里,我也总是收到。我究竟做错了什么?
我得到这个输出:
哈希是从微型 tds (命中 SQL 服务器)提供的,并且当在其上使用 puts 时:
ruby - Heroku Cedar OpenSSL 错误上的 FreeTDS buildpack
我有一个想在 heroku 上部署的 sinatra rack ruby 应用程序。该应用程序需要连接到 SQL Server 数据库。为此,我需要 TinyTds gem。
宝石文件
捆绑安装后的 Gemfile.lock
TinyTds 需要 Heroku 显然没有的 FreeTDS。因此,互联网上有一些疯狂的解决方案,在类似 heroku 的虚拟机中进行静态编译和类似的东西。最合理的解决方案是为我的应用程序设置一个包含 FreeTDS 的自定义 buildpack:
然而
编辑:我的问题是如何让 heroku 使用 tiny_tds。
ruby-on-rails - Rails tiny_tds 符号查找错误
在 Rails 应用程序或控制台中针对带有 tiny_tds 的 SQL Server 运行查询时出现错误。注意:gem install tiny_tds
成功了。
未定义符号:rb_thread_blocking_region
我的系统设置:
- Centos 7.0
- 红宝石 2.2.0p0
- 导轨 4.1.4
安装了 freetds 和 freetds-devel:
我的 MSSQL 部分config/database.yml
看起来像(我正在连接到远程主机):
我的宝石文件:
该查询在 Centos 6.3 上运行。可能有任何版本冲突吗?
ruby - TinyTds::Error: 过程需要参数
鉴于以下红宝石:
以上产生以下结果:
执行 sql 的前两次尝试返回就好了。第三个,从文件中读取到数组中,然后加入,炸弹。我知道这一定与字符串的处理有关。但我无法弄清楚这一点。
我究竟做错了什么?为什么它(tinytds 或 activerecord?)认为这是一个存储过程?
我想要做的是在一个文件夹中有一大堆sql脚本,然后一个一个地执行它们。
详细信息:ruby 1.9.3、activerecord (4.2.0) 和 tiny_tds (0.6.2-x86-mingw32)
ruby-on-rails - `rake db:schema:dump` creates schema with empty system tables
I am creating test and development databases that mirror the schema of an existing production database. First, I create db/schema.rb by dumping the production schema:
This creates a schema.rb which has an empty table for each system table:
These empty tables cause an error when I try to create the test and development databases:
If, in schema.rb, I delete the definitions for the system tables, then the databases are created normally:
How can I keep rake db:schema:dump
from dumping the definitions for empty system tables that cannot be created?
Versions:
- Microsoft SQL Server 2014 - 12.0.2000.8 (x64)
- rails (4.2.1)
- activerecord-sqlserver-adapter (4.2.4)
- tiny_tds from github:
- git://github.com/rails-sqlserver/tiny_tds.git
- Commit c4e59ba82c0cc55a5587cec1b7d5100d1b1ccaf4
ruby-on-rails-4 - Rails 4 ActiveRecord Sql Server - 无法将二进制文件保存到图像列中
我们正在努力将我们的应用程序升级到最新版本的 Ruby & Rails。我们的应用程序与旧数据库 (SQL Server 2008 R2) 集成,该数据库具有包含图像数据类型列的表(我们无法将此列更改为 varbinary(max))。以前我们能够将二进制文件保存到图像列中。但是现在我们遇到了转换错误。
我们正在努力升级到以下(除其他外):
- 导轨 4.2.1
- ActiveRecord_SQLServer_Adapter (4.2.4)
- tiny_tds (0.6.3.rc1)
- freeTDS (v0.91.112)
当我们现在尝试保存到图像列时,我们会收到类似于以下内容的错误:
TinyTds::Error: 字符串后的未闭合引号
在研究 tiny_tds 和 activerecord_sqlserver_adapter 中的各种问题后,我们决定创建第二个与第一个匹配的表,但将数据类型从 image 更改为 varbinary(max)。我们可以将二进制文件保存到列中。
导致挑战的代码在后台作业中,我们从 s3 抓取图像,将它们存储在本地,然后将图像推送到数据库中。同样,我们不控制遗留数据库,因此无法更改数据类型(或者面临为什么我们首先将图像存储在数据库中的问题)。
鉴于升级破坏了我们保存的图像,我们正试图找出如何最好地确定修复。我们显然可以回滚,直到我们找到一个有效的版本。不过我们希望能找到解决办法。有人有想法么?
更新:我们添加了以下配置,因为我们在要插入的表上有触发器:ActiveRecord::ConnectionAdapters::SQLServerAdapter.use_output_inserted = true
当我们删除此配置时,我们会收到以下错误:
TinyTds::Error: The target table 'doc' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.
注意:我们无法对触发器进行任何修改。
ruby - 续集:如何在带有 tinytds 的视图中使用“order by”
我需要使用order by
带有续集、tinytds 和 MSSQL的 - 子句创建一个视图
当我这样做时,我得到了错误
我的示例代码:
在 SQL 端查看解决方案很容易。而不是
我需要一个
我找到了一个带有额外过时列的解决方案(没有该列dummy
,我得到一个无效的逗号):
可以使用以下方法进行类似的解决方案limit
:
但我正在寻找更好的解决方案。还有更好的可能性吗?
如果很重要:
- 红宝石 2.1
- 续集 4.19
- tiny_tds-0.6.2-x64-mingw32
- MSSQL 10.50.2500.0,64 位
ruby - Heroku FreeTDS,如何将 Rasil SQL Server 与 TinyTDS 与 Multi Buildpacks 一起使用
我必须在我的 Rails 4.2.3 中使用“Tiny TDS”gem,当然在 Heroku 的 cedar-14 上我不能,因为 FreeTDS 不再适用。
如何在 Heroku cedar-14 上使用 FreeTDS?
我在网上看,我发现了这个:
https://github.com/foraker/heroku-buildpack-freetds
他说要将此与“heroku-buildpack-multi”一起使用,这个:https ://github.com/ddollar/heroku-buildpack-multi
但我不明白怎么做!
我必须在本地电脑上创建“.buildpacks”文件吗?
然后我必须“git push heroku master”?
这个程序今天仍然有效吗?
或者我必须使用这个:https ://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app
请帮助我,谢谢。
更新:
我找到了如何在 Heroku 上安装 FreeTDS 使用这个:
有了这个:
有了这个.buildpacks:
但是现在,在部署之后,我得到了一个错误:
和应用程序崩溃。
怎么修?
这些是日志:
部署:
部署后:
更新:
如果我heroku run bash
跑到这里:
我有这个:
这是什么:
libsybdb.so.5?
另一个更新:
我还尝试将下载网址更改为:
但没有,同样的错误:
ruby-on-rails - 如何将 SQL Server 表视图用作 Rails 模型(只读)?
我使用 SQL Server 作为 Rails 项目的数据库。我正在尝试创建一些模型以用于第 3 方数据库,并且只想从此数据库中读取。所以我创建了一个我想为其创建对象的表的视图,然后我想将我的活动记录模型指向它。但是,在 Rails 控制台中,我没有得到预期的结果。返回一些正确信息的唯一示例是当我count
对对象执行 a 时,如下面的示例 3 所示。
我正在使用以下 gem 连接到我的 SQL Server:
我也安装了 freetds-dev 0.91-6build1
示例 1
示例 2
示例 3
传入模型.rb
游戏模型.rb
数据库.yml
macos - 无法在 Mac OS X Yosemite v10.10.2 上安装 tiny_tds
我在 MAC OS X yosemite 上使用 RubyMine IDE。在尝试安装 tiny_tds 时出现以下错误
sudo gem install tiny_tds -v '0.6.2'
构建原生扩展。这可能需要一段时间...
错误:安装 tiny_tds 时出错:
错误:无法构建 gem 原生扩展。
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
检查 iconv.h 中的 iconv_open() ... 否
检查 -liconv 中的 iconv_open()... 是
检查 sybfront.h... 是的
检查 sybdb.h... 是
检查 -lsybdb 中的 tdsdbopen()... 否
缺少freetds。
* extconf.rb 失败 * 由于某种原因无法创建 Makefile,可能缺少必要的库和/或头文件。检查 mkmf.log 文件以获取更多详细信息。您可能需要配置选项。
提供的配置选项:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--没有-make-prog
--srcdir=。
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
--启用查找
--禁用查找
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/
--with-freetds-dir
--without-freetds-dir
--with-freetds-include
--without-freetds-include=${freetds-dir}/include
--with-freetds-lib
--without-freetds-lib=${freetds-dir}/
--with-iconvlib
--without-iconvlib
--with-sybdblib
--不带sybdblib
Gem 文件将继续安装在 /Library/Ruby/Gems/2.0.0/gems/tiny_tds-0.6.2 以供检查。结果记录到 /Library/Ruby/Gems/2.0.0/gems/tiny_tds-0.6.2/ext/tiny_tds/gem_make.out
我已经安装了freetds
酿造安装freetds
当我做 brew list 时我可以看到它
但是当我再次执行 sudo gem install tiny_tds 时,由于 freetds 丢失,它给了我错误。
请帮忙。
谢谢