source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | tonytonyjan/jaro_winkler | https://github.com/tonytonyjan/jaro_winkler | jaro_winkler.gemspec | Ruby | mit | 221 | master | 1,551 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'jaro_winkler/version'
Gem::Specification.new do |spec|
spec.name = 'jaro_winkler'
spec.version = JaroWinkler::VERSION
spec.authors = ['Jian Weihang']
spec.email = 'tonytonyjan@gmail.com'
... |
github | tonytonyjan/jaro_winkler | https://github.com/tonytonyjan/jaro_winkler | jaro_winkler.java.gemspec | Ruby | mit | 221 | master | 1,574 | # frozen_string_literal: true
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'jaro_winkler/version'
Gem::Specification.new do |spec|
spec.name = 'jaro_winkler'
spec.version = JaroWinkler::VERSION
spec.authors = ['Jian Weihang']
spec.email = 'tonytonyj... |
github | tonytonyjan/jaro_winkler | https://github.com/tonytonyjan/jaro_winkler | benchmark/samples.rb | Ruby | mit | 221 | master | 537 | SAMPLES = {
ascii: [
%w[al al], %w[martha marhta], %w[jones johnson], %w[abcvwxyz cabvwxyz],
%w[dwayne duane], %w[dixon dicksonx], %w[fvie ten]
].freeze,
utf8: [
%w[馬英九 馬英丸], %w[蔡英文 蔡中文], %w[簡煒航 簡偉航], %w[焦玟綾 焦紋綾],
%w[眼球中央電視台 眼球中英電視台], %w[床前明月光 床前日月光],
%w[海水退了就知道誰沒穿褲子 海水退了就知道誰沒穿襪子],
%w[阿里山的... |
github | tonytonyjan/jaro_winkler | https://github.com/tonytonyjan/jaro_winkler | benchmark/measure.rb | Ruby | mit | 221 | master | 1,403 | # frozen_string_literal: true
require File.expand_path('../samples', __FILE__)
gem 'jaro_winkler', ENV['JARO_WINKLER_VERSION'] || ARGV[0] || raise('missing ENV["JARO_WINKLER_VERSION"]')
require 'benchmark'
require 'csv'
csv = CSV.new($stdout)
n = 100_000
version = Gem::Version.new(Gem.loaded_specs["jaro_winkler"].ver... |
github | tonytonyjan/jaro_winkler | https://github.com/tonytonyjan/jaro_winkler | benchmark/pure.rb | Ruby | mit | 221 | master | 572 | # frozen_string_literal: true
require File.expand_path('../env', __FILE__)
require 'benchmark'
require 'jaro_winkler/jaro_winkler_pure'
require 'fuzzystringmatch'
n = 10_000
Benchmark.bmbm do |x|
x.report "jaro_winkler (#{`git rev-parse --short HEAD`.chop!})" do
n.times { SAMPLES[:ascii].each { |str1, str2| Ja... |
github | tonytonyjan/jaro_winkler | https://github.com/tonytonyjan/jaro_winkler | benchmark/native.rb | Ruby | mit | 221 | master | 904 | # frozen_string_literal: true
require File.expand_path('../env', __FILE__)
require 'benchmark'
require 'jaro_winkler/jaro_winkler_ext'
require 'fuzzystringmatch'
require 'hotwater'
require 'amatch'
n = 100_000
Benchmark.bmbm do |x|
x.report "jaro_winkler (#{`git rev-parse --short HEAD`.chop!})" do
n.times { SA... |
github | tonytonyjan/jaro_winkler | https://github.com/tonytonyjan/jaro_winkler | benchmark/env.rb | Ruby | mit | 221 | master | 260 | # frozen_string_literal: true
$LOAD_PATH << File.expand_path('../../lib', __FILE__)
require 'bundler'
Bundler.setup(:benchmark)
require File.expand_path('../samples', __FILE__)
def gem_name_with_version(gem)
"#{gem} (#{Gem.loaded_specs[gem].version})"
end |
github | tonytonyjan/jaro_winkler | https://github.com/tonytonyjan/jaro_winkler | lib/jaro_winkler.rb | Ruby | mit | 221 | master | 385 | # frozen_string_literal: true
require 'jaro_winkler/version'
if RUBY_ENGINE == 'ruby'
begin
require 'jaro_winkler/jaro_winkler_ext'
rescue LoadError
# Fall back to the pure implementation if the extension
# can't be loaded for any reason (e.g. it was never built)
require 'jaro_winkler/jaro_winkler... |
github | tonytonyjan/jaro_winkler | https://github.com/tonytonyjan/jaro_winkler | lib/jaro_winkler/adjusting_table.rb | Ruby | mit | 221 | master | 604 | # frozen_string_literal: true
module JaroWinkler
DEFAULT_ADJ_TABLE = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
[
%w[A E], %w[A I], %w[A O], %w[A U], %w[B V], %w[E I], %w[E O], %w[E U], %w[I O],
%w[I U], %w[O U], %w[I Y], %w[E Y], %w[C G], %w[E F], %w[W U], %w[W V], %w[X K],
%w[S Z], %w[X S],... |
github | tonytonyjan/jaro_winkler | https://github.com/tonytonyjan/jaro_winkler | lib/jaro_winkler/jaro_winkler_pure.rb | Ruby | mit | 221 | master | 4,110 | # frozen_string_literal: true
require 'jaro_winkler/adjusting_table'
module JaroWinkler
class Error < RuntimeError; end
class InvalidWeightError < Error; end
DEFAULT_WEIGHT = 0.1
DEFAULT_THRESHOLD = 0.7
DEFAULT_OPTIONS = {
jaro: { adj_table: false, ignore_case: false },
jaro_winkler: { weight: DEFAU... |
github | tonytonyjan/jaro_winkler | https://github.com/tonytonyjan/jaro_winkler | test/tests.rb | Ruby | mit | 221 | master | 5,651 | # encoding: utf-8
module Tests
def test_similarity
assert_similarity 0.9667, 'henka', 'henkan'
assert_similarity 1.0, 'al', 'al'
assert_similarity 0.9611, 'martha', 'marhta'
assert_similarity 0.8324, 'jones', 'johnson'
assert_similarity 0.9583, 'abcvwxyz', 'cabvwxyz... |
github | azai91/alfred-drive-workflow | https://github.com/azai91/alfred-drive-workflow | src/google-drive.rb | Ruby | mit | 221 | master | 21,238 | #!/usr/bin/ruby
#
# Copyright (c) 2018 Allan Odgaard
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, mer... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | Rakefile | Ruby | apache-2.0 | 220 | main | 4,227 | require "logstash/devutils/rake"
task :'vendor-ecs-schemata' do
download_ecs_schemata(:v1, elasticsearch_major: 7, ecs_release_tag: 'v1.12.1')
download_ecs_schemata(:v1, elasticsearch_major: 8, ecs_release_tag: 'v1.12.1', generated_for: 7)
download_ecs_schemata(:v1, elasticsearch_major: 9, ecs_release_tag: 'v1.1... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | logstash-output-elasticsearch.gemspec | Ruby | apache-2.0 | 220 | main | 2,019 | Gem::Specification.new do |s|
s.name = 'logstash-output-elasticsearch'
s.version = '12.1.3'
s.licenses = ['apache-2.0']
s.summary = "Stores logs in Elasticsearch"
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline ... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | Gemfile | Ruby | apache-2.0 | 220 | main | 445 | source 'https://rubygems.org'
gemspec
logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
if Dir.exist?(logstash_path) && use_logstash_source
gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
gem 'logstash-core-p... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/spec_helper.rb | Ruby | apache-2.0 | 220 | main | 509 | require "logstash/devutils/rspec/spec_helper"
require "logstash/outputs/elasticsearch"
module LogStash::Outputs::ElasticSearch::SpecHelper
end
RSpec.configure do |config|
config.include LogStash::Outputs::ElasticSearch::SpecHelper
end
# remove once plugin starts consuming elasticsearch-ruby v8 client
def elastic_... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/es_spec_helper.rb | Ruby | apache-2.0 | 220 | main | 6,223 | require_relative './spec_helper'
require 'elasticsearch'
require 'json'
require 'cabin'
# remove this condition and support package once plugin starts consuming elasticsearch-ruby v8 client
# in elasticsearch-ruby v7, ILM APIs were in a separate xpack gem, now directly available
unless elastic_ruby_v8_client_availab... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/unit/http_client_builder_spec.rb | Ruby | apache-2.0 | 220 | main | 8,587 | require "logstash/devutils/rspec/spec_helper"
require "logstash/outputs/elasticsearch"
require "logstash/outputs/elasticsearch/http_client"
require "logstash/outputs/elasticsearch/http_client_builder"
describe LogStash::Outputs::ElasticSearch::HttpClientBuilder do
describe "auth setup with url encodable passwords" d... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/unit/outputs/license_check_spec.rb | Ruby | apache-2.0 | 220 | main | 2,308 | require "logstash/devutils/rspec/spec_helper"
require "logstash/outputs/elasticsearch/http_client"
require "logstash/outputs/elasticsearch/license_checker"
describe LogStash::Outputs::ElasticSearch::LicenseChecker do
# Note that the actual license checking logic is spec'ed in pool_spec.rb
context "LicenseChecker... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/unit/outputs/elasticsearch_ssl_spec.rb | Ruby | apache-2.0 | 220 | main | 8,681 | require_relative "../../../spec/spec_helper"
require 'stud/temporary'
describe "SSL options" do
let(:manticore_double) { double("manticoreSSL #{self.inspect}") }
let(:settings) { { "ssl_enabled" => true, "hosts" => "localhost", "pool_max" => 1, "pool_max_per_route" => 1 } }
subject do
require "logstash/out... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/unit/outputs/elasticsearch_spec.rb | Ruby | apache-2.0 | 220 | main | 75,083 | require_relative "../../../spec/spec_helper"
require "base64"
require "flores/random"
require 'concurrent/atomic/count_down_latch'
require "logstash/outputs/elasticsearch"
require 'logstash/plugin_mixins/ecs_compatibility_support/spec_helper'
require 'rspec/collection_matchers'
describe LogStash::Outputs::ElasticSearc... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/unit/outputs/elasticsearch_proxy_spec.rb | Ruby | apache-2.0 | 220 | main | 2,774 | require_relative "../../../spec/spec_helper"
require 'stud/temporary'
require 'manticore/client'
describe "Proxy option" do
let(:settings) { { "hosts" => "node01" } }
subject {
LogStash::Outputs::ElasticSearch.new(settings)
}
before do
allow(::Manticore::Client).to receive(:new).with(any_args).and_cal... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/unit/outputs/error_whitelist_spec.rb | Ruby | apache-2.0 | 220 | main | 1,850 | require "logstash/outputs/elasticsearch"
require_relative "../../../spec/es_spec_helper"
describe "whitelisting error types in expected behavior" do
let(:template) { '{"template" : "not important, will be updated by :index"}' }
let(:event1) { LogStash::Event.new("somevalue" => 100, "@timestamp" => "2014-11-17T20:3... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/unit/outputs/elasticsearch/data_stream_support_spec.rb | Ruby | apache-2.0 | 220 | main | 18,564 | require_relative '../../../../spec/spec_helper'
require "logstash/outputs/elasticsearch/data_stream_support"
describe LogStash::Outputs::ElasticSearch::DataStreamSupport do
subject { LogStash::Outputs::ElasticSearch.new(options) }
let(:options) { { 'hosts' => [ 'localhost:12345' ] } }
let(:es_version) { '7.10.... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/unit/outputs/elasticsearch/http_client_spec.rb | Ruby | apache-2.0 | 220 | main | 15,476 | require_relative "../../../../spec/spec_helper"
require "logstash/outputs/elasticsearch/http_client"
require "cabin"
require "webrick"
require "java"
describe LogStash::Outputs::ElasticSearch::HttpClient do
let(:ssl) { nil }
let(:base_options) do
opts = {
:hosts => [::LogStash::Util::SafeURI.new("127.0.0... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/unit/outputs/elasticsearch/template_manager_spec.rb | Ruby | apache-2.0 | 220 | main | 7,804 | require_relative "../../../../spec/spec_helper"
require "logstash/outputs/elasticsearch/template_manager"
describe LogStash::Outputs::ElasticSearch::TemplateManager do
describe ".default_template_path" do
context "elasticsearch 7.x" do
it "chooses the 7x template" do
expect(described_class.default... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/unit/outputs/elasticsearch/http_client/pool_spec.rb | Ruby | apache-2.0 | 220 | main | 22,450 | require "logstash/devutils/rspec/spec_helper"
require "logstash/outputs/elasticsearch/http_client"
require 'cabin'
describe LogStash::Outputs::ElasticSearch::HttpClient::Pool do
let(:logger) { Cabin::Channel.get }
let(:adapter) { LogStash::Outputs::ElasticSearch::HttpClient::ManticoreAdapter.new(logger, {}) }
le... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/unit/outputs/elasticsearch/http_client/manticore_adapter_spec.rb | Ruby | apache-2.0 | 220 | main | 5,413 | require "logstash/devutils/rspec/spec_helper"
require "logstash/outputs/elasticsearch/http_client"
require 'cabin'
describe LogStash::Outputs::ElasticSearch::HttpClient::ManticoreAdapter do
let(:logger) { Cabin::Channel.get }
let(:options) { {} }
subject { described_class.new(logger, options) }
it "should ra... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/support/elasticsearch/api/actions/delete_ilm_policy.rb | Ruby | apache-2.0 | 220 | main | 627 | # Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License;
# you may not use this file except in compliance with the Elastic License.
module Elasticsearch
module API
module Actions
# Update the password of th... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/support/elasticsearch/api/actions/put_ilm_policy.rb | Ruby | apache-2.0 | 220 | main | 954 | # Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License;
# you may not use this file except in compliance with the Elastic License.
module Elasticsearch
module API
module Actions
# @option arguments [String... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/support/elasticsearch/api/actions/get_ilm_policy.rb | Ruby | apache-2.0 | 220 | main | 601 | # Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License;
# you may not use this file except in compliance with the Elastic License.
module Elasticsearch
module API
module Actions
# Retrieve the list of inde... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/index_spec.rb | Ruby | apache-2.0 | 220 | main | 16,613 | require_relative "../../../spec/es_spec_helper"
require "logstash/outputs/elasticsearch"
require 'cgi'
describe "TARGET_BULK_BYTES", :integration => true do
let(:target_bulk_bytes) { LogStash::Outputs::ElasticSearch::TARGET_BULK_BYTES }
let(:event_count) { 1000 }
let(:events) { event_count.times.map { event }.to... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/retry_spec.rb | Ruby | apache-2.0 | 220 | main | 6,430 | require "logstash/outputs/elasticsearch"
require_relative "../../../spec/es_spec_helper"
describe "failures in bulk class expected behavior", :integration => true do
let(:template) { '{"template" : "not important, will be updated by :index"}' }
let(:event1) { LogStash::Event.new("somevalue" => 100, "@timestamp" =>... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/ilm_spec.rb | Ruby | apache-2.0 | 220 | main | 19,570 | require_relative "../../../spec/es_spec_helper"
shared_examples_for 'an ILM enabled Logstash' do
context 'with a policy with a maximum number of documents' do
let (:policy) { small_max_doc_policy }
let (:ilm_policy_name) { "logstash-policy-custom"}
let (:settings) { super().merge("ilm_policy" => ilm_pol... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/ingest_pipeline_spec.rb | Ruby | apache-2.0 | 220 | main | 2,719 | require_relative "../../../spec/es_spec_helper"
describe "Ingest pipeline execution behavior", :integration => true do
subject! do
require "logstash/outputs/elasticsearch"
settings = {
"hosts" => "#{get_host_port()}",
"pipeline" => "apache-logs",
"data_stream" => 'false',
"ecs_compati... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/parent_spec.rb | Ruby | apache-2.0 | 220 | main | 2,966 | require_relative "../../../spec/es_spec_helper"
require "logstash/outputs/elasticsearch"
describe "join type field", :integration => true do
shared_examples "a join field based parent indexer" do
let(:index) { 10.times.collect { rand(10).to_s }.join("") }
let(:type) { "_doc" }
let(:event_count) { 1000... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/painless_update_spec.rb | Ruby | apache-2.0 | 220 | main | 4,113 | require_relative "../../../spec/es_spec_helper"
describe "Update actions using painless scripts", :integration => true, :update_tests => 'painless' do
require "logstash/outputs/elasticsearch"
def get_es_output( options={} )
settings = {
"manage_template" => true,
"index" => "logstash-update",
... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/metrics_spec.rb | Ruby | apache-2.0 | 220 | main | 2,609 | require_relative "../../../spec/es_spec_helper"
describe "metrics", :integration => true do
subject! do
require "logstash/outputs/elasticsearch"
settings = {
"manage_template" => false,
"hosts" => "#{get_host_port()}",
# write data to a random non templated index to ensure the bulk partiall... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/data_stream_spec.rb | Ruby | apache-2.0 | 220 | main | 2,222 | require_relative "../../../spec/es_spec_helper"
require "logstash/outputs/elasticsearch"
describe "data streams", :integration => true do
let(:ds_name) { "logs-#{ds_dataset}-default" }
let(:ds_dataset) { 'integration_test' }
let(:options) do
{ "data_stream" => 'true', "data_stream_dataset" => ds_dataset, "... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/routing_spec.rb | Ruby | apache-2.0 | 220 | main | 1,678 | require_relative "../../../spec/es_spec_helper"
shared_examples "a routing indexer" do
let(:index) { 10.times.collect { rand(10).to_s }.join("") }
let(:type) { 10.times.collect { rand(10).to_s }.join("") }
let(:event_count) { 10000 + rand(500) }
let(:routing) { "not_implemented" }
let(:config) { "n... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/no_es_on_startup_spec.rb | Ruby | apache-2.0 | 220 | main | 3,528 | require "logstash/outputs/elasticsearch"
require_relative "../../../spec/es_spec_helper"
describe "elasticsearch is down on startup", :integration => true do
let(:event1) { LogStash::Event.new("somevalue" => 100, "@timestamp" => "2014-11-17T20:37:17.223Z", "@metadata" => {"retry_count" => 0}) }
let(:event2) { LogS... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/create_spec.rb | Ruby | apache-2.0 | 220 | main | 2,224 | require_relative "../../../spec/es_spec_helper"
describe "client create actions", :integration => true do
require "logstash/outputs/elasticsearch"
def get_es_output(action, id, version=nil, version_type=nil)
settings = {
"manage_template" => true,
"index" => "logstash-create",
"template_over... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/unsupported_actions_spec.rb | Ruby | apache-2.0 | 220 | main | 2,566 | require_relative "../../../spec/es_spec_helper"
describe "Unsupported actions testing...", :integration => true do
require "logstash/outputs/elasticsearch"
INDEX = "logstash-unsupported-actions-rejected"
def get_es_output( options={} )
settings = {
"manage_template" => true,
"index" => INDEX,
... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/delete_spec.rb | Ruby | apache-2.0 | 220 | main | 2,305 | require_relative "../../../spec/es_spec_helper"
require "logstash/outputs/elasticsearch"
describe "Versioned delete", :integration => true do
require "logstash/outputs/elasticsearch"
let(:es) { get_client }
before :each do
# Delete all templates first.
# Clean ES of data before we start.
es.indice... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/update_spec.rb | Ruby | apache-2.0 | 220 | main | 4,678 | require_relative "../../../spec/es_spec_helper"
describe "Update actions without scripts", :integration => true do
require "logstash/outputs/elasticsearch"
def get_es_output( options={} )
settings = {
"manage_template" => true,
"index" => "logstash-update",
"template_overwrite" => true,
... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/compressed_indexing_spec.rb | Ruby | apache-2.0 | 220 | main | 2,915 | require_relative "../../../spec/es_spec_helper"
require "logstash/outputs/elasticsearch"
require "stringio"
RSpec::Matchers.define :a_valid_gzip_encoded_string do
match { |data|
expect { Zlib::GzipReader.new(StringIO.new(data)).read }.not_to raise_error
}
end
[ {"http_compression" => true}, {"compression_leve... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/sniffer_spec.rb | Ruby | apache-2.0 | 220 | main | 2,086 | require_relative "../../../spec/es_spec_helper"
require "logstash/outputs/elasticsearch/http_client"
require "json"
require "socket"
describe "pool sniffer", :integration => true do
let(:logger) { Cabin::Channel.get }
let(:adapter) { LogStash::Outputs::ElasticSearch::HttpClient::ManticoreAdapter.new(logger, {}) }
... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/index_version_spec.rb | Ruby | apache-2.0 | 220 | main | 3,632 | require_relative "../../../spec/es_spec_helper"
require "logstash/outputs/elasticsearch"
describe "Versioned indexing", :integration => true do
require "logstash/outputs/elasticsearch"
let(:es) { get_client }
before :each do
# Delete all templates first.
# Clean ES of data before we start.
es.indic... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | spec/integration/outputs/templates_spec.rb | Ruby | apache-2.0 | 220 | main | 5,033 | require_relative "../../../spec/es_spec_helper"
describe "index template expected behavior", :integration => true do
let(:ecs_compatibility) { fail('spec group does not define `ecs_compatibility`!') }
subject! do
require "logstash/outputs/elasticsearch"
allow_any_instance_of(LogStash::Outputs::ElasticSear... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | lib/logstash/outputs/elasticsearch.rb | Ruby | apache-2.0 | 220 | main | 29,317 | # encoding: utf-8
require "logstash/namespace"
require "logstash/environment"
require "logstash/outputs/base"
require "logstash/json"
require "concurrent/atomic/atomic_boolean"
require "stud/interval"
require "socket" # for Socket.gethostname
require "thread" # for safe queueing
require "uri" # for escaping user input
... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | lib/logstash/outputs/elasticsearch/template_manager.rb | Ruby | apache-2.0 | 220 | main | 6,770 | module LogStash; module Outputs; class ElasticSearch
class TemplateManager
LEGACY_TEMPLATE_ENDPOINT = '_template'.freeze
INDEX_TEMPLATE_ENDPOINT = '_index_template'.freeze
# To be mixed into the elasticsearch plugin base
def self.install_template(plugin)
return unless plugin.manage_template
... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | lib/logstash/outputs/elasticsearch/http_client.rb | Ruby | apache-2.0 | 220 | main | 18,937 | require "logstash/outputs/elasticsearch"
require 'logstash/outputs/elasticsearch/http_client/pool'
require 'logstash/outputs/elasticsearch/http_client/manticore_adapter'
require 'cgi'
require 'zlib'
require 'stringio'
require 'java'
module LogStash; module Outputs; class ElasticSearch;
# This is a constant instead o... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | lib/logstash/outputs/elasticsearch/http_client_builder.rb | Ruby | apache-2.0 | 220 | main | 8,643 | require 'cgi'
require "base64"
module LogStash; module Outputs; class ElasticSearch;
module HttpClientBuilder
def self.build(logger, hosts, params)
client_settings = {
:pool_max => params["pool_max"],
:pool_max_per_route => params["pool_max_per_route"],
:check_connection_timeout => ... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | lib/logstash/outputs/elasticsearch/ilm.rb | Ruby | apache-2.0 | 220 | main | 2,625 | module LogStash; module Outputs; class ElasticSearch
module Ilm
ILM_POLICY_PATH = "default-ilm-policy.json"
def setup_ilm
logger.warn("Overwriting supplied index #{@index} with rollover alias #{@ilm_rollover_alias}") unless default_index?(@index)
@index = @ilm_rollover_alias
maybe_create_r... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | lib/logstash/outputs/elasticsearch/license_checker.rb | Ruby | apache-2.0 | 220 | main | 1,467 | module LogStash; module Outputs; class ElasticSearch
class LicenseChecker
def initialize(logger)
@logger = logger
end
# Figure out if the provided license is appropriate or not
# The appropriate_license? methods is the method called from LogStash::Outputs::ElasticSearch::HttpClient::Pool#healt... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | lib/logstash/outputs/elasticsearch/data_stream_support.rb | Ruby | apache-2.0 | 220 | main | 12,193 | module LogStash module Outputs class ElasticSearch
# DS specific behavior/configuration.
module DataStreamSupport
# @api private
ENABLING_ECS_GUIDANCE = <<~END.tr("\n", " ")
Elasticsearch data streams require that events adhere to the Elastic Common Schema.
While `ecs_compatibility` can be set ... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | lib/logstash/outputs/elasticsearch/http_client/pool.rb | Ruby | apache-2.0 | 220 | main | 19,191 | require "concurrent/atomic/atomic_reference"
require "logstash/plugin_mixins/elasticsearch/noop_license_checker"
module LogStash; module Outputs; class ElasticSearch; class HttpClient;
class Pool
class NoConnectionAvailableError < Error; end
class BadResponseCodeError < Error
attr_reader :url, :respons... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | lib/logstash/outputs/elasticsearch/http_client/manticore_adapter.rb | Ruby | apache-2.0 | 220 | main | 5,802 | require 'manticore'
require 'cgi'
module LogStash; module Outputs; class ElasticSearch; class HttpClient;
DEFAULT_HEADERS = { "Content-Type" => "application/json", 'x-elastic-product-origin' => 'logstash-output-elasticsearch' }
class ManticoreAdapter
attr_reader :manticore, :logger
def initialize(logge... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | lib/logstash/plugin_mixins/elasticsearch/api_configs.rb | Ruby | apache-2.0 | 220 | main | 13,680 | require 'logstash/plugin_mixins/ca_trusted_fingerprint_support'
module LogStash; module PluginMixins; module ElasticSearch
module APIConfigs
# This module defines common options that can be reused by alternate elasticsearch output plugins such as the elasticsearch_data_streams output.
DEFAULT_HOST = ::LogS... |
github | logstash-plugins/logstash-output-elasticsearch | https://github.com/logstash-plugins/logstash-output-elasticsearch | lib/logstash/plugin_mixins/elasticsearch/common.rb | Ruby | apache-2.0 | 220 | main | 18,091 | require "logstash/outputs/elasticsearch/template_manager"
module LogStash; module PluginMixins; module ElasticSearch
module Common
# This module defines common methods that can be reused by alternate elasticsearch output plugins such as the elasticsearch_data_streams output.
attr_reader :hosts
# These... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | Gemfile | Ruby | mit | 220 | release-3.7 | 1,263 | # frozen_string_literal: true
source 'https://rubygems.org'
gemspec
eval_gemfile 'Gemfile.devtools'
if ENV['DRY_TYPES_FROM_MASTER'].eql?('true')
gem 'dry-types', github: 'dry-rb/dry-types', branch: 'main'
end
# git 'https://github.com/rom-rb/rom.git', branch: 'release-5.4' do
# gem 'rom'
# gem 'rom-changeset... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | rom-sql.gemspec | Ruby | mit | 220 | release-3.7 | 1,283 | lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rom/sql/version'
Gem::Specification.new do |spec|
spec.name = 'rom-sql'
spec.version = ROM::SQL::VERSION.dup
spec.authors = ['Piotr Solnica']
spec.email = ['piotr.solnica@gma... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql.rb | Ruby | mit | 220 | release-3.7 | 480 | # frozen_string_literal: true
require 'rom/core'
require 'rom/sql/version'
require 'rom/sql/errors'
require 'rom/configuration_dsl'
require 'rom/sql/plugins'
require 'rom/sql/relation'
require 'rom/sql/mapper_compiler'
require 'rom/sql/associations'
require 'rom/sql/gateway'
require 'rom/sql/migration'
require 'rom... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/plugins/relation/sql/auto_restrictions.rb | Ruby | mit | 220 | release-3.7 | 2,547 | # frozen_string_literal: true
require 'rom/support/notifications'
module ROM
module Plugins
module Relation
module SQL
# Generates methods for restricting relations by their indexed attributes
#
# @example
# rom = ROM.container(:sql, 'sqlite::memory') do |config|
... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/plugins/relation/sql/instrumentation.rb | Ruby | mit | 220 | release-3.7 | 3,486 | # frozen_string_literal: true
module ROM
module Plugins
module Relation
module SQL
# Instrumentation for relations and commands
#
# This plugin allows configuring a notification system, that will be used
# to instrument interactions with databases, it's based on an abstract ... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/plugins/relation/sql/postgres/explain.rb | Ruby | mit | 220 | release-3.7 | 1,786 | # frozen_string_literal: true
module ROM
module Plugins
module Relation
module SQL
module Postgres
# PG-specific extensions which adds `Relation#explain` method
#
# @api public
module Explain
# Show the execution plan
# One of four dif... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/plugins/relation/sql/postgres/full_text_search.rb | Ruby | mit | 220 | release-3.7 | 2,742 | # frozen_string_literal: true
module ROM
module Plugins
module Relation
module SQL
module Postgres
# PG-specific extensions which adds `Relation#full_text_search` method
#
# @api public
module FullTextSearch
# Run a full text search on PostgreSQL.... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/plugins/relation/sql/postgres/streaming.rb | Ruby | mit | 220 | release-3.7 | 3,388 | # frozen_string_literal: true
module ROM
module Plugins
module Relation
module SQL
module Postgres
# PG-specific extensions which adds `Relation#stream` method
#
# @api public
module Streaming
extend Notifications::Listener
class Stre... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/group_dsl.rb | Ruby | mit | 220 | release-3.7 | 474 | # frozen_string_literal: true
require 'rom/sql/dsl'
module ROM
module SQL
# @api private
class GroupDSL < DSL
private
# @api private
def respond_to_missing?(_meth, _include_private = false)
true
end
# @api private
def method_missing(meth, ...)
if schema.... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/type_dsl.rb | Ruby | mit | 220 | release-3.7 | 877 | # frozen_string_literal: true
module ROM
module SQL
# Type DSL used by Types.define method
#
# @api public
class TypeDSL
attr_reader :definition
attr_reader :input_constructor
attr_reader :output_constructor
# @api private
def initialize(value_type)
if value_t... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/index.rb | Ruby | mit | 220 | release-3.7 | 604 | # frozen_string_literal: true
module ROM
module SQL
# @api private
class Index
extend Initializer
include Dry::Equalizer(:attributes, :name)
param :attributes
option :name, optional: true
option :unique, default: -> { false }
alias_method :unique?, :unique
optio... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/gateway.rb | Ruby | mit | 220 | release-3.7 | 6,540 | # frozen_string_literal: true
require 'logger'
require 'sequel/core'
require 'dry/core/constants'
require 'rom/types'
require 'rom/gateway'
require 'rom/sql/migration'
require 'rom/sql/commands'
require 'rom/sql/transaction'
module ROM
module SQL
# SQL gateway
#
# @api public
class Gateway < ROM::... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/schema.rb | Ruby | mit | 220 | release-3.7 | 4,297 | # frozen_string_literal: true
require 'rom/schema'
require 'rom/sql/schema/dsl'
require 'rom/sql/order_dsl'
require 'rom/sql/group_dsl'
require 'rom/sql/projection_dsl'
require 'rom/sql/restriction_dsl'
require 'rom/sql/index'
require 'rom/sql/foreign_key'
require 'rom/sql/schema/inferrer'
module ROM
module SQL
... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/attribute_wrapping.rb | Ruby | mit | 220 | release-3.7 | 808 | # frozen_string_literal: true
module ROM
module SQL
# @api private
module AttributeWrapping
# Return if the attribute type is from a wrapped relation
#
# Wrapped attributes are used when two schemas from different relations
# are merged together. This way we can identify them easily a... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/restriction_dsl.rb | Ruby | mit | 220 | release-3.7 | 826 | # frozen_string_literal: true
require 'rom/sql/dsl'
module ROM
module SQL
# @api private
class RestrictionDSL < DSL
# @api private
def call(&block)
arg, kwargs = select_relations(block.parameters)
if kwargs.nil?
instance_exec(arg, &block)
else
instanc... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/order_dsl.rb | Ruby | mit | 220 | release-3.7 | 450 | # frozen_string_literal: true
require 'rom/sql/dsl'
module ROM
module SQL
# @api private
class OrderDSL < DSL
private
def respond_to_missing?(_meth, _include_private = false)
true
end
# @api private
def method_missing(meth, ...)
if schema.key?(meth)
... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/types.rb | Ruby | mit | 220 | release-3.7 | 1,181 | # frozen_string_literal: true
require 'sequel/core'
require 'sequel/sql'
require 'rom/types'
require 'rom/sql/type_dsl'
module ROM
module SQL
module Types
include ROM::Types
# Define a foreign key attribute type
#
# @example with default Int type
# attribute :user_id, Types.For... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/type_extensions.rb | Ruby | mit | 220 | release-3.7 | 1,342 | # frozen_string_literal: true
module ROM
module SQL
# Type-specific methods
#
# @api public
module TypeExtensions
class << self
# Gets extensions for a type
#
# @param type [Dry::Types::Type] wrapped
#
# @return [Hash]
#
# @api public
... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/dsl.rb | Ruby | mit | 220 | release-3.7 | 2,520 | # frozen_string_literal: true
require 'concurrent/map'
require 'rom/support/inflector'
require 'rom/constants'
module ROM
module SQL
# @api private
class DSL < BasicObject
# @!attribute [r] schema
# @return [SQL::Schema]
attr_reader :schema
# @!attribute [r] relations
# @r... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/type_serializer.rb | Ruby | mit | 220 | release-3.7 | 1,034 | # frozen_string_literal: true
require 'dry/core/class_attributes'
module ROM
module SQL
# @api private
class TypeSerializer
extend Dry::Core::ClassAttributes
defines :registry
def self.register(db_type, builder)
registry[db_type] = builder
end
def self.[](db_type)
... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/foreign_key.rb | Ruby | mit | 220 | release-3.7 | 399 | # frozen_string_literal: true
module ROM
module SQL
# @api private
class ForeignKey
extend Initializer
include Dry::Equalizer(:attributes, :parent_table, :options)
DEFAULT_PARENT_KEYS = %i[id].freeze
param :attributes
param :parent_table, type: Dry::Types['strict.symbol']
... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/relation.rb | Ruby | mit | 220 | release-3.7 | 8,112 | # frozen_string_literal: true
require 'rom/sql/types'
require 'rom/sql/schema'
require 'rom/sql/attribute'
require 'rom/sql/wrap'
require 'rom/sql/transaction'
require 'rom/sql/relation/reading'
require 'rom/sql/relation/writing'
module ROM
module SQL
# Sequel-specific relation extensions
#
# @api publ... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/function.rb | Ruby | mit | 220 | release-3.7 | 8,814 | # frozen_string_literal: true
require 'rom/attribute'
require 'rom/sql/attribute_wrapping'
module ROM
module SQL
# Specialized attribute type for defining SQL functions
#
# @api public
class Function < ROM::Attribute
include AttributeWrapping
class << self
# @api private
... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/errors.rb | Ruby | mit | 220 | release-3.7 | 1,227 | # frozen_string_literal: true
require 'sequel/deprecated'
require 'sequel/exceptions'
require 'rom/sql/error'
module ROM
module SQL
MissingConfigurationError = Class.new(StandardError)
NoAssociationError = Class.new(StandardError)
DatabaseError = Class.new(Error)
ConstraintError ... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/migration.rb | Ruby | mit | 220 | release-3.7 | 4,306 | # frozen_string_literal: true
require 'rom/sql/migration/migrator'
require 'rom/sql/migration/schema_diff'
module ROM
module SQL
class << self
# Trap for the migration runner. By default migrations are
# bound to the gateway you're using to run them.
# You also can explicitly pass a configurat... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/mapper_compiler.rb | Ruby | mit | 220 | release-3.7 | 616 | # frozen_string_literal: true
require 'rom/mapper_compiler'
module ROM
module SQL
class MapperCompiler < ROM::MapperCompiler
def visit_attribute(node)
name, _, meta_options = node
if meta_options[:wrapped]
[extract_wrapped_name(node), from: meta_options[:alias]]
else
... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/attribute.rb | Ruby | mit | 220 | release-3.7 | 11,877 | # frozen_string_literal: true
require 'sequel/core'
require 'dry/core/cache'
require 'rom/attribute'
require 'rom/sql/type_extensions'
require 'rom/sql/projection_dsl'
require 'rom/sql/attribute_wrapping'
require 'rom/sql/attribute_aliasing'
module ROM
module SQL
# Extended schema attributes tailored for SQL ... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/transaction.rb | Ruby | mit | 220 | release-3.7 | 438 | # frozen_string_literal: true
module ROM
module SQL
# @api private
class Transaction < ::ROM::Transaction
attr_reader :connection
private :connection
def initialize(connection)
super()
@connection = connection
end
def run(opts = EMPTY_HASH)
connection.t... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/error.rb | Ruby | mit | 220 | release-3.7 | 338 | # frozen_string_literal: true
module ROM
module SQL
class Error < StandardError
attr_reader :original_exception
def initialize(original_exception)
super(original_exception.message)
@original_exception = original_exception
set_backtrace(original_exception.backtrace)
end
... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/associations.rb | Ruby | mit | 220 | release-3.7 | 253 | # frozen_string_literal: true
require 'rom/sql/associations/many_to_many'
require 'rom/sql/associations/many_to_one'
require 'rom/sql/associations/one_to_many'
require 'rom/sql/associations/one_to_one'
require 'rom/sql/associations/one_to_one_through' |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/extensions.rb | Ruby | mit | 220 | release-3.7 | 633 | # frozen_string_literal: true
require 'dry/core/extensions'
module ROM
module SQL
extend Dry::Core::Extensions
register_extension(:postgres) do
require 'rom/sql/extensions/postgres'
end
register_extension(:mysql) do
require 'rom/sql/extensions/mysql'
end
register_extension(:sq... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/plugins.rb | Ruby | mit | 220 | release-3.7 | 494 | # frozen_string_literal: true
require 'rom/plugins/relation/sql/instrumentation'
require 'rom/plugins/relation/sql/auto_restrictions'
require 'rom/sql/plugin/associates'
require 'rom/sql/plugin/nullify'
require 'rom/sql/plugin/pagination'
ROM.plugins do
adapter :sql do
register :nullify, ROM::SQL::Plugin::Null... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/projection_dsl.rb | Ruby | mit | 220 | release-3.7 | 1,773 | # frozen_string_literal: true
require 'rom/sql/dsl'
require 'rom/sql/function'
module ROM
module SQL
# Projection DSL used in reading API (`select`, `select_append` etc.)
#
# @api public
class ProjectionDSL < DSL
# Return a string literal that will be directly used in an SQL statement or query... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/attribute_aliasing.rb | Ruby | mit | 220 | release-3.7 | 2,573 | # frozen_string_literal: true
module ROM
module SQL
# @api private
module AttributeAliasing
# Return a new attribute with an alias
#
# @example
# users[:id].aliased(:user_id)
#
# @return [SQL::Attribute]
#
# @api public
def aliased(alias_name)
n... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/wrap.rb | Ruby | mit | 220 | release-3.7 | 1,058 | # frozen_string_literal: true
require 'rom/relation/wrap'
module ROM
module SQL
# Specialized wrap relation for SQL
#
# This type of relations is returned when using `Relation#wrap` and it uses
# a join, unlike `Relation#combine` which makes separate queries. This
# means a relation is restricte... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/tasks/migration_tasks.rake | Ruby | mit | 220 | release-3.7 | 2,668 | # frozen_string_literal: true
require 'pathname'
require 'fileutils'
module ROM
module SQL
module RakeSupport
MissingEnv = Class.new(StandardError)
class << self
def run_migrations(options = {})
gateway.run_migrations(migration_options.merge(options))
end
def crea... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/associations/core.rb | Ruby | mit | 220 | release-3.7 | 699 | # frozen_string_literal: true
module ROM
module SQL
module Associations
# Core SQL association API
#
# @api private
module Core
# @api private
def preload(target, loaded)
source_key, target_key = join_keys.flatten(1)
target_pks = loaded.pluck(source_ke... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/associations/many_to_many.rb | Ruby | mit | 220 | release-3.7 | 2,320 | # frozen_string_literal: true
require 'rom/associations/many_to_many'
require 'rom/sql/associations/core'
require 'rom/sql/associations/self_ref'
module ROM
module SQL
module Associations
class ManyToMany < ROM::Associations::ManyToMany
include Associations::Core
include Associations::Self... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/associations/self_ref.rb | Ruby | mit | 220 | release-3.7 | 900 | # frozen_string_literal: true
module ROM
module SQL
module Associations
module SelfRef
def self.included(klass)
super
klass.memoize :join_keys, :source_table, :source_alias, :source_attr, :target_attr
end
# @api public
def join_keys
{ source_at... |
github | rom-rb/rom-sql | https://github.com/rom-rb/rom-sql | lib/rom/sql/associations/many_to_one.rb | Ruby | mit | 220 | release-3.7 | 1,583 | # frozen_string_literal: true
require 'rom/associations/many_to_one'
require 'rom/sql/associations/core'
require 'rom/sql/associations/self_ref'
module ROM
module SQL
module Associations
class ManyToOne < ROM::Associations::ManyToOne
include Associations::Core
include Associations::SelfRef... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.