0
누군가 나를 도울 수 있는지 궁금합니다.삽입시 데이터 변환과 관련된 문제가 있습니까?
나는 현재 어떤 클래스를
class Sha1(ColumnClause):
pass
@compiles(Sha1)
def compile_sha1(element, compiler, **kw):
return 'PASSWORD("{}")'.format(element.name)
이 내가 열을 삽입 할 SQLAlchemy의의 ORM을 사용할 때 나는 SHA1 (값)으로 속성을 전달하고 그 일을하도록 할 수 있습니다. 그러나 목적을 테스트하기 위해 우리는
에서 생성 된 출력을 변경됩니다 특정 모델의 SQL은 생성되는 방식을 재정의, SQLAlchemy의에서, 방법이 있나요insert = model.__table__.insert(values)
session.execute(insert)
같은 데이터베이스 무언가로 우리의 모델을로드
insert into model (uuid, password) values (:uuid, :password)
는
insert into model (uuid, password) values (:uuid, PASSWORD(:password))
모든 아이디어 같은 내 SHA1 클래스를 사용하는 방법?