<commit_before>require 'test_helper'

class DatabaseTest < ActiveSupport::TestCase

  def setup
    clean_db
  end

  test "query" do
    User.delete_all
    User.create(name: 'Igor')
    query = RailsDb::SqlQuery.new('select count(*) as users_count from users')
    query.execute
    assert_equal query.data.columns, ['users_count']
    assert_equal query.data.rows, [[1]]
    assert_not_nil query.explain
  end

end<commit_msg>fixing issue for postgres<commit_after>require 'test_helper'

class DatabaseTest < ActiveSupport::TestCase

  def setup
    clean_db
  end

  test "query" do
    User.create(name: 'Igor')
    query = RailsDb::SqlQuery.new('select count(*) as users_count from users')
    query.execute
    assert_equal query.data.columns, ['users_count']
    assert_equal query.data.rows.collect{|e| e.collect{|ee| ee.to_i}} , [[1]]
    assert_not_nil query.explain
  end

end
{'fraction_non_alphanumeric': 0.11036036036036036, 'fraction_numerical': 0.0022522522522522522, 'mean_word_length': 3.99438202247191, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3357901', 'n_tokens_mistral': 299, 'n_tokens_neox': 290, 'n_words': 69}