This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
sqltable
====


## 定位
一个命令行工具,让你便捷的操纵sql表格


## 使用
在某个文件夹下写上你的 `config.py` 文件,如下所示:

```python
# -*- coding: utf-8 -*-

from __future__ import print_function, unicode_literals, absolute_import


SOURCE_DB_URL = "mysql+pymysql://root@localhost/"
SOURCE_DB_NAME = "grid_cdnzz"
SOURCE_TABLE = "consume_day_record"
TARGET_DB_URL = "mysql+pymysql://root@localhost/"
TARGET_DB_NAME = "grid_cdnzz"
TARGET_TABLE = "consume_day_record2"


from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
TARGET_BASE = declarative_base()
from sqlalchemy.dialects.mysql import BIGINT as BigInteger

class TARGET_TABLE_MODEL(TARGET_BASE):
__tablename__ = TARGET_TABLE

id = Column(Integer, primary_key=True)
uid = Column(Integer)
count = Column(BigInteger(unsigned = True))
category = Column(String(20))
recorded = Column(DateTime)

def TARGET_PROCESS(item):
one = TARGET_TABLE_MODEL()
one.uid = item['uid']
one.count = item['count'] * 1024 * 1024 * 1024
one.category = item['category']
one.recorded = item['recorded']
return one


```
然后在配置文件那里打开终端,输入:
```
sqltable transform
```
即会自动进行某个table的转换,

## 配置说明

- SOURCE_DB_URL :: 源数据库URL
- SOURCE_DB_NAME :: 源数据库database名字
- SOURCE_TABLE :: 源表格名
- TARGET_DB_URL :: 目标数据库URL
- TARGET_DB_NAME :: 目标数据库名
- TARGET_TABLE :: 目标表格名
- TARGET_TABLE_MODEL :: 目标表格的输出模型
- TARGET_PROCESS :: 对于目标输出表格的处理函数,参数item是源表格的字典值形式,利用上面定义的
目标表格输出模型,返回一个该对象。



## 本模块的完善需要您的建议!
Release History

Release History

0.1.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
sqltable-0.1.0.tar.gz (5.9 kB) Copy SHA256 Checksum SHA256 Source Jun 1, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting