All Projects → mahmoudimus → sqlalchemy-citext

mahmoudimus / sqlalchemy-citext

Licence: other
CITEXT type for SQLAlchemy

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to sqlalchemy-citext

Fpage
Tornado project generator. Start a project with tornado, mako/jinjia2 and sqlalchemy/peewee in a minute.
Stars: ✭ 242 (+830.77%)
Mutual labels:  sqlalchemy
serialchemy
SQLAlchemy model serialization
Stars: ✭ 34 (+30.77%)
Mutual labels:  sqlalchemy
alembic utils
An alembic/sqlalchemy extension for migrating sql views, functions, triggers, and policies
Stars: ✭ 105 (+303.85%)
Mutual labels:  sqlalchemy
Statik
Multi-purpose static web site generator aimed at developers.
Stars: ✭ 249 (+857.69%)
Mutual labels:  sqlalchemy
graphene-sqlalchemy-filter
Filters for Graphene SQLAlchemy integration
Stars: ✭ 117 (+350%)
Mutual labels:  sqlalchemy
sqlathanor
Serialization / De-serialization support for the SQLAlchemy Declarative ORM
Stars: ✭ 105 (+303.85%)
Mutual labels:  sqlalchemy
Autoline
建议你使用更新的AutoLink平台
Stars: ✭ 227 (+773.08%)
Mutual labels:  sqlalchemy
mad-migration
Database migration tool for migrate different structured databases.
Stars: ✭ 29 (+11.54%)
Mutual labels:  sqlalchemy
sqlalchemy exasol
SQLAlchemy dialect for EXASOL
Stars: ✭ 34 (+30.77%)
Mutual labels:  sqlalchemy
SQL-for-Data-Analytics
Perform fast and efficient data analysis with the power of SQL
Stars: ✭ 187 (+619.23%)
Mutual labels:  sqlalchemy
Flask Boilerplate
Simple flask boilerplate with Postgres, Docker, and Heroku/Zeit now
Stars: ✭ 251 (+865.38%)
Mutual labels:  sqlalchemy
FRDP
Boilerplate code for quick docker implementation of REST API with JWT Authentication using FastAPI, PostgreSQL and PgAdmin ⭐
Stars: ✭ 55 (+111.54%)
Mutual labels:  sqlalchemy
FastAPI-template
Feature rich robust FastAPI template.
Stars: ✭ 660 (+2438.46%)
Mutual labels:  sqlalchemy-orm
Python For Entrepreneurs Course Demos
Contains all the "handout" materials for Talk Python's Python for Entrepreneurs course. This includes notes and the final version of the website code.
Stars: ✭ 247 (+850%)
Mutual labels:  sqlalchemy
flask for startups
Flask boilerplate using a services oriented structure
Stars: ✭ 210 (+707.69%)
Mutual labels:  sqlalchemy
Flask Base
A simple Flask boilerplate app with SQLAlchemy, Redis, User Authentication, and more.
Stars: ✭ 2,680 (+10207.69%)
Mutual labels:  sqlalchemy
Daisy-OLD
“ Hey there 👋 I'm Daisy „ PTB Group management bot with some extra features
Stars: ✭ 43 (+65.38%)
Mutual labels:  sqlalchemy
d2a
A translator Django into SQLAlchemy.
Stars: ✭ 23 (-11.54%)
Mutual labels:  sqlalchemy
flask-restalchemy
Flask extension to build REST APIs based on SQLAlchemy models
Stars: ✭ 34 (+30.77%)
Mutual labels:  sqlalchemy
sqlalchemy-utc
SQLAlchemy type to store aware datetime values
Stars: ✭ 87 (+234.62%)
Mutual labels:  sqlalchemy

sqlalchemy-citext

Creates a SQLAlchemy user defined type to understand PostgreSQL's CIText extension.

Installation

This requires some kind of PostgreSQL compatible db-api driver already installed in order to work.

Make sure you have something like psycopg2 already installed.

pip install sqlalchemy-citext

Usage

from sqlalchemy import create_engine, MetaData, Integer
from sqlalchemy.schema import Column, Table
import sqlalchemy.orm as orm

from citext import CIText


engine = create_engine('postgresql://localhost/test_db')
meta = MetaData()

test_table = Table('test', meta,
    Column('id', Integer(), primary_key=True),
    Column('txt', CIText()))

conn = engine.connect()

meta.bind = conn
meta.drop_all()
meta.create_all()

class TestObj(object):
    def __init__(self, id_, txt):
        self.id = id_
        self.txt = txt

    def __repr__(self):
        return "TestObj(%r, %r)" % (self.id, self.txt)

orm.mapper(TestObj, test_table)
Session = orm.sessionmaker(bind=engine)
ses = Session()

to = TestObj(1, txt='FooFighter')
ses.add(to)
ses.commit()
row = ses.query(TestObj).filter(TestObj.txt == 'foofighter').all()
assert len(row) == 1
print row
ses.close()

License

sqlalchemy-citext is an MIT/BSD dual-Licensed library.

Contribute

  • Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
  • Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).
  • Write a test which shows that the bug was fixed or that the feature works as expected.
  • Send a pull request and bug the maintainer until it gets merged and published.
  • Make sure to add yourself to the author's file in setup.py and the Contributors section below :)

Contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].