Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.381.597 Times

Sheba 0.0.7

Company: Paul J. Davis
Date Added: November 20, 2013  |  Visits: 407

Sheba

Report Broken Link
Printer Friendly Version


Product Homepage
Download (42 downloads)



Sheba offers SQL management for people that don't mind SQL.<br /><br />Motivation<br /><br />I can write SQL faster than I can figure out the various library and ORM abstraction layers. Writing SQL directly in code is pretty disgusting. So I stole an idea from the Axamol SQL Library and along with a couple updates have created this library.<br /><br />What is it?<br /><br />First, we'll consider some basic query definitions:<br /><br />name: create_roles_table<br />type: update<br />sql: |<br /> CREATE TABLE roles<br /> (<br /> scene text,<br /> name text,<br /> actor text,<br /> UNIQUE(scene, name)<br /> )<br />---<br />name: add_role<br />type: update<br />sql: |<br /> INSERT<br /> INTO roles(scene, name, actor)<br /> VALUES (${scene}, ${name}, ${actor})<br />---<br />name: list_roles<br />sql: |<br /> SELECT name,<br /> actor<br /> FROM roles<br /> ORDER BY<br /> name ASC<br /><br />This is a YAML file that defines a couple queries for working with a simple table that lists scenes, roles, and actors. This is the contents of the ./test/yaml/conn-queries.yaml that's used in a couple of the test cases in case you're curious.<br /><br />Now, to use these in some code:<br /><br />>>> import sheba<br />>>> lib = sheba.Library.from_file('test/yaml/conn-queries.yaml')<br />>>> conn = sheba.connect(lib, 'sqlite3', ':memory:')<br /><br />Now that we have a connection, lets create the roles table:<br /><br />>>> conn.u.create_roles_table()<br />-1<br /><br />The -1 is due to DDL statements not returning row information. I could technically create a third class of statement types so avoid this, but in the not doctest world you can just ignore that return value.<br /><br />Next we'll insert a couple rows:<br /><br />>>> conn.u.add_role(scene="Parrot Sketch", name="MR PRALINE", actor="John Cleese")<br />1<br />>>> conn.u.add_role(scene="Parrot Sketch", name="SHOP OWNER", actor="Machale Palin")<br />1<br />>>> conn.u.add_role(scene="Parrot Sketch", name="DEAD PARROT", actor="Fake Parrot")<br />1<br /><br />Yep, it's that simple. And lastly, we'll list the roles in the table:<br /><br /> >>> for row in conn.q.list_roles():<br /> ... print "Name: %(name)s Actor: %(actor)s" % row<br /> ...<br /> Name: DEAD PARROT Actor: Fake Parrot<br /> Name: MR PRALINE Actor: John Cleese<br /> Name: SHOP OWNER Actor: Machale Palin<br /><br />As they say, "Wicked awesome."<br /><br />Possible Query Attributes<br /><br />The example above only used name, type, and sql. Only name and sql are absolutely required. The full list of attributes is:<br /><br /><br /> * name - The name used to reference this query from Python<br /><br /> *desc - An explanation of the query for documentation.<br /><br /> * type - query or update. Defaults to query.<br /><br /> * dbs - A list of database names that this SQL will work with. The default<br /><br /> value is None which is interpreted as "Use this query when no SQL has been defined for the current connections database connection."<br /><br /> * sql - The actual query. SQL is passed through Mako with access to<br /><br /> any parameter names that were provide to the query. To bind a parameter in a query, simply print the value with standard Mako syntax like ${my_parameter_name}. Sheba will automatically replace it with the proper bind variable syntax and pass the supplied value onto the database connection.<br /><br />Note<br /><br />It may appear at first glance that the dynamic queries are writing parameter values directly into the SQL. They are NOT. The actual values passed along into the template context are UUID's that will be replaced with bind parameters syntax appropriate to your database driver. If you're asking yourself, "What if I do want the actual value?" you should go fix all of your SQL injection vulnerabilities.<br />#md5=43731671b9d164a20c5a3ef9094c8edb

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: Actor Actual Connuadd Rolescene Dquotparrot Couple Create Database Names Parameter Print Query Roles Scene Sheba Sketchquot Syntax Table Updatesql We039ll
Users rating: 0/10

License: Freeware Size: 20.48 KB
USER REVIEWS
More Reviews or Write Review


SHEBA RELATED
Libraries  -  Blocks (formerly Database Objects) 2.2.2
Database Objects it's a Java library containing visual (SWING) and non visual components to easily create database RAD applications. The focus traversal between components is entirely controlled by a special component. PDF reports and Excel...
 
Database Tools  -  Database Test Suite 5.0.1.0
This Database Test Suite aims to create database workload test kits used to simulate heavy user loads for OLTP, Decision Support, and e-commerce database transactions. These test kits can also be used to gather performance results for Linux and other
1.85 MB  
Database Tools  -  PHPLens 1.0
PHPLens allows PHP developers to quickly create database-driven web applications. With PHPLens, web pages can be quickly created to present data as html tables with facilities to create, edit, paginate, search and delete records.
 
Database Tools  -  PHP Booosta! 1.0
PHP Booosta provides you with easy-to-use components to create database driven web applications in PHP without having any clue about what "SQL" is. It also allows you to create quick HTML-Forms and offers several other things.
 
Database Tools  -  PHPLens for Scripts 1.0
PHPLens allows PHP developers to quickly create database-driven web applications. With PHPLens, web pages can be quickly created to present data as html tables with facilities to create, edit, paginate, search and delete records.
2.66 MB  
Database Tools  -  Publish Query to Word for SQL Server Pro 1.06.42
Publish Query to Word for SQL Server Pro is an application that was designed to help you create a copy of a query results as a Word document. The application supports all Microsoft SQL Server versions. Limited support for 6.0 and 6.5 versions is...
 
Database Tools  -  Publish Query to HTML for SQL Server Pro 1.06.42
Publish Query to HTML tool allows you to create presentable copy of a query results as HTML documents. This database export tool supports all modern versions of Microsoft SQL Server. Limited support for 6.0 and 6.5 versions is available too....
 
Programming  -  Bonobo Framework code generator 1.0
PHP code generator that can quickly and easilly create code for database operations (create-read-update-delete), with flexible code-generation options, based on table data gathered from a DB.
33.54 KB  
Database Tools  -  CrunchyFrog 0.1.1
CrunchyFrog is a database schema browser and query tool written in Python/PyGTK. CrunchyFrogs current status is under development, but its useable for the most common tasks..
112.64 KB  
Database Tools  -  Publish Query to Word for SQL Server Standard 1.06.42
Publish Query to Word for SQL Server Standard will help you setup a connection to a database and export a query to a Word document. The application features two methods to connect with the datrabase: with predefined data source or using direct...
 
NEW DOWNLOADS IN LINUX SOFTWARE, BUSINESS
Linux Software  -  EasyEDA PCB Designer for Linux 2.0.0
EasyEDA, a great web based EDA(Electronics Design Automation) tool, online PCB tool, online PCB software for electronics engineers, educators, students, makers and enthusiasts. Theres no need to install any software. Just open EasyEDA in any...
34.4 MB  
Linux Software  -  wpCache® WordPress HTTP Cache 1.9
wpCache® is a high-performance, distributed object, caching system application, generic in nature, but intended for use in speeding up dynamic web applications, by decreasing database load time. wpCache® decreases dramatically the page...
3.51 MB  
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Business  -  Inventoria Inventory Software Free 11.06
Inventoria is professional inventory stock management software for Windows that allows you to manage inventory in one or several locations. Manage your stock levels by categories, locations, and vendors. Combine Inventoria with HourGuard, Express...
611.18 KB  
Business  -  Java SQL Admin Tool for Linux 2.4.3
This is a Java-based Admin-Tool for SQL-Databases via JDBC. It needs to have JDK 1.6 underneath In the beginnings of Java I had my first look at this exciting product. So I decided to learn more about Java. As beeing a developer for...
686.08 KB  
Business  -  DBBalancer 0.4.4
DBBalancer is some sort of middleware that would sit in between of database clients, like C, C++, TCL, Java JDBC, Perl DBI, and a database server. Currently the only server supported is Postgres, but the architecture is open to embrace more...
174.08 KB  
Business  -  Postgres Plus 9.0.4
Postgres Plus is a distribution of PostgreSQL that contains the following additional features integrated in a convenient installation package: Postgres Studio for administration, Procedural Language Debugger, GridSQL Parallel Query, MySQL...
43.06 MB  
Business  -  Apatar Data Integration 1.12.23
Apatar is an open source Extract, Transform, and Load (ETL) project. Modular architecture delivers: 1. Visual job designer/mapping 2. Connectivity to all major data sources 3. Flexible Deployment Options (GUI, or server engine with JVM, or...
25.94 MB