Skip to content

Instantly share code, notes, and snippets.

(function(global) {
var get = Ember.get, set = Ember.set, doc = document;
global.FastSelectComponent = Ember.Component.extend({
items: null,
valuePath: 'value',
labelPath: 'label',
value: null,
selected: null,
@ebryn
ebryn / SassMeister-input.scss
Created March 23, 2015 02:54
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
.my-component-a42dce {
& {
border: 1px solid black;
}
SELECT TOP 4 * FROM (
SELECT TOP 4 * FROM (
SELECT TOP 8 [users].[id], [users].[name]
FROM [users]
ORDER BY [users].[id] ASC) AS tmp1
ORDER BY [tmp1].[id] DESC) AS tmp2
ORDER BY [tmp2].[id] ASC
# From within a Arel compiler we'd like to call #invert_directions(orders)
# to reverse the order of all the order clauses
def invert_direction_value(str)
case str
when /\bDESC\b/i then str.gsub!(/\bDESC\b/i, "ASC")
when /\bASC\b/i then str.gsub!(/\bASC\b/i, "DESC")
end
str
end
diff --git a/ext/tiny_tds/extconf.rb b/ext/tiny_tds/extconf.rb
index c53f29e..42ddf0e 100644
--- a/ext/tiny_tds/extconf.rb
+++ b/ext/tiny_tds/extconf.rb
@@ -70,6 +70,6 @@ end
unless have_freetds?
abort "-----\nCan not find FreeTDS's db-lib or include directory.\n-----"
end
-
+$CFLAGS += "-fno-stack-protector"
diff --git a/ext/tiny_tds/client.c b/ext/tiny_tds/client.c
index 70796b2..aa16c6a 100644
--- a/ext/tiny_tds/client.c
+++ b/ext/tiny_tds/client.c
@@ -88,7 +88,7 @@ static VALUE allocate(VALUE klass) {
static VALUE rb_tinytds_tds_version(VALUE self) {
GET_CLIENT_WRAPPER(self);
- return INT2FIX(dbtds(cwrap->client));
+ return INT2FIX(8);
diff --git a/ext/tiny_tds/result.c b/ext/tiny_tds/result.c
index 7d9f0fa..91f951b 100644
--- a/ext/tiny_tds/result.c
+++ b/ext/tiny_tds/result.c
@@ -157,8 +157,12 @@ static VALUE rb_tinytds_result_fetch_row(VALUE self, ID timezone, int symbolize_
val = ENCODED_STR_NEW2(converted_unique);
break;
}
- case SYBDATETIME4:
- dbconvert(rwrap->client, coltype, data, data_len, SYBDATETIME, data, data_len);
ejb-mbp2:activerecord-sqlserver-adapter ebryn$ ruby test/benchmark/query_sqlserver.rb
-- create_table(:test_benchmarks, {:force=>true})
-> 0.0715s
Query Sqlserver
===============
Author: Erik Bryn
Date: October 19, 2010
Summary: Benchmark SQL Server Queries
System Information
> @client.execute("SELECT 1 AS [rs1];\nSELECT 2 AS [rs2]").each.inspect
=> [[{"rs1" => 1}], [{"rs2" => 2}]]
diff --git a/ext/tiny_tds/result.c b/ext/tiny_tds/result.c
index 307a2c1..24cbb23 100644
--- a/ext/tiny_tds/result.c
+++ b/ext/tiny_tds/result.c
@@ -285,12 +285,23 @@ static VALUE rb_tinytds_result_each(int argc, VALUE * argv, VALUE self) {
if (rwrap->number_of_results == 0) {
rwrap->results = result;
} else if (rwrap->number_of_results == 1) {
- VALUE multi_resultsets = rb_ary_new();
- rb_ary_store(multi_resultsets, 0, rwrap->results);