bradrf / rsql Goto Github PK
View Code? Open in Web Editor NEWShell for MySQL connections (optionally forwarded over SSH) with Ruby-based recipes to save common queries and processing tasks.
License: MIT License
Shell for MySQL connections (optionally forwarded over SSH) with Ruby-based recipes to save common queries and processing tasks.
License: MIT License
# Merge results from other queries into this one so that they
# can all be displayed once.
#
def merge!(results)
end
In this way it can be used from a higher interaction level by say a CGI script not to mention enhance testability.
consider removing (deprecating) register and just simply use introspection of the methods to determine those that were loaded after those part of the normal eval class
probably work best as a new class (eval_context) and replace existing class (eval_runner)
Wrap calling of mysql query in a thread to make it interruptable (might need to re-establish a connection if it's stopped but expected a reply...look at the source).
It would be nice to be able to see a recipe's body from the command line like you can with "desc
". In other words, to see what a recipe will do.e.g. this is a pita: r[0].first[1].to_f
add ability for user to define a global mapping of column names to bang evaluaters so the same columns will always call the bangs to convert content even without the bang explicitly stated (e.g. always use relative_time when the LastUpdateTime column is seen in any query) -- also consider if there should be ways to regex match the column
fixme:
rsql> .list_abnormal_nodes | safe_save(@results, 'abnormal');
can't convert Hash into Integer
/usr/lib/ruby/1.8/yaml.rb:389:in `hash'
/usr/lib/ruby/1.8/yaml.rb:389:in `quick_emit'
/usr/lib/ruby/1.8/yaml/rubytypes.rb:107:in `to_yaml'
/usr/lib/ruby/1.8/yaml/rubytypes.rb:18:in `node_export'
/usr/lib/ruby/1.8/yaml/rubytypes.rb:18:in `add'
/usr/lib/ruby/1.8/yaml/rubytypes.rb:18:in `to_yaml'
/usr/lib/ruby/1.8/yaml/rubytypes.rb:17:in `each'
/usr/lib/ruby/1.8/yaml/rubytypes.rb:17:in `to_yaml'
/usr/lib/ruby/1.8/yaml/rubytypes.rb:16:in `map'
/usr/lib/ruby/1.8/yaml/rubytypes.rb:16:in `to_yaml'
/usr/lib/ruby/1.8/yaml.rb:391:in `call'
/usr/lib/ruby/1.8/yaml.rb:391:in `emit'
/usr/lib/ruby/1.8/yaml.rb:391:in `quick_emit'
/usr/lib/ruby/1.8/yaml/rubytypes.rb:15:in `to_yaml'
/usr/lib/ruby/1.8/yaml.rb:117:in `dump'
Some people prefer to see all upper case hex values.
change registrations so that they are real methods that can be invoked from anywhere instead of just outputs of sql (i.e. so i can call info_by_ip and expect it to run the query from another recipe, might need to consider what it does -- i.e. should it simply return the mysql results, shoudl it display the results? etc)
Fix overlap of functionality between getting input in rsql and parsing input in commands.rb (e.g. they both duplicate the concepts of looking for exit/quit as well as what the end character(s) should be)
fix so that if the command is a ruby command, the semicolons don't need to be escaped, it just looks for the last one or something (not sure how to deal with multiline enter case)
rsql> . a ||= {};
undefined local variable or method `a' for #<RSQL::EvalContext:0x7ee351ec>
in `safe_eval': compile error
syntax error, unexpected '=', expecting kEND
begin;= {}
For example, it should be fairly straightforward to produce output in YAML, JSON, or XML based on what Ruby libraries are available on the running system. Only require them if requested to use them for output. This would make sense for batch runs as well as an attribute of a recipe or even at runtime so that it can be piped to a recipe for handling.
# Merge results from other queries into this one so that they
# can all be displayed once.
#
def merge!(results)
end
Right now, if a block runs one or more queries and they have a syntax error in the SQL, there is no way to see the original text of the query.
this way it can save the content based on the variable's real name
This is what RubyGems uses to expose docs online. https://rubydoc.tenderapp.com/kb/getting-started-with-rubydocinfo/documenting-with-yard
The default Ruby exception when calling with the wrong number of arguments is not very understandable. Rsql should show something friendlier.
Fix multiline dump to be columnar sensitive (i.e. all but the first line will need a prefix of previous column length whitespace.
For example, allow for the following logic to be skipped when we don't want the field hexified:
elsif HEX_RANGE.include?(field.type) && val =~ /[^[:print:]\s]/
val = @@eval_context.to_hexstr(val)
end
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.