Comments (10)
Well, you know like this
$ records --path ~/bd/test.sql --formar csv
and is ready, the table in the desired format
from records.
and make exports from the file into the table
$ records export --path ~/test.csv
user: ...
password: ...
in which database: ...
table name: ...
result export: OK
from records.
I like this idea, very much!
from records.
Print results out to console:
$ records myquery.sql
Print results as JSON out to console:
$ records myquery.sql json
Add parameters (for parameterized queries):
$ records myquery.sql --params 'Python|Ruby'
Export functionality:
$ records myquery.sql csv > data.csv
from records.
what do you mean (language=python) ?
$ records myquery.sql language=python
from records.
@andrew-tifon language
is a parameter to the query.
from records.
It's param=None ?
Database.query(query, param=None ...)
from records.
@andrew-tifon updated my example :)
from records.
Okay, I worked on this last night. Got the help string down with usage/etc.
Records: SQL for Humans™
A Kenneth Reitz project.
Usage:
records <query> [<format>] [--url=<url>] [--params <params>...]
records (-h | --help)
Options:
-h --help Show this screen.
--url=<url> The database URL to use. Defaults to $DATABASE_URL.
--params Prameterized query. Subsequent arguments are treated as
parameters to the query.
Supported Formats:
csv, tsv, json, yaml, html, xls, xlsx, dbf, latex, ods
Note: xls, xlsx, dbf, and ods formats are binary, and should only be
used with piped output e.g. '$ records sql xls > sql.xls'.
Notes:
- While you may specify a Postgres connection string with --url, records
will automatically default to the value of $DATABASE_URL, if available.
- Query is intended to be the path of a SQL file, however a query string
can be provided instead. Use this feature discernfully; it's dangerous.
- Records is intended for report-style exports of database queries, and
has not yet been optimized for extremely large data dumps.
Cake:
✨ 🍰 ✨
from records.
Relased!
from records.
Related Issues (20)
- Can't get values from sqlite database
- RecordCollection support fetch many
- records.Database.query can't return affected rowcounts? HOT 1
- mssql query works for sqlalchemy but not for records HOT 1
- (sqlite3.ProgrammingError) Cannot operate on a closed database.
- Within transaction, the error disappeared
- database connections
- Can I get multiple sql command's output
- 导出excel无异常情况,但是无法生成xls文件 HOT 1
- can not read sqlserver! data can be read using sqlalchemy but records no! HOT 2
- MSSQL Queries are broken
- Is records being maintained? HOT 3
- How to get the last sql run
- Export XLS error HOT 1
- This library may no longer be maintained, and many problems 1 year ago have not been dealt with HOT 6
- records python3 is not compatible with new sqlalchemy release 1.4.0 HOT 7
- records (v0.5.3) is incompatible with latest Pandas (v1.2.4) cause they have requires different openpyxl version dependency, is there any way to fix this issue? HOT 2
- db.query('SELECT * FROM persons) can't execute
- Records is not compatible with Python 3.8+ HOT 1
- sqlalchemy 2.0 support. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from records.