Graybyt3 Was Here
Linux cloud.locucionar.com 3.10.0-1160.81.1.el7.x86_64 #1 SMP Fri Dec 16 17:29:43 UTC 2022 x86_64
Apache
91.191.211.241
/
opt
/
alt
/
python38
/
lib64
/
python3.8
/
site-packages
/
playhouse
/
__pycache__
[ HOME ]
Exec
Submit
File Name : shortcuts.cpython-38.opt-1.pyc
U S��W# � @ s� d dl Z d dlT d dlmZ e jd dkr>d dlmZ dd� Zddd �Zd d� Zdd � Z ddd�Z ddd�ZG dd� de�Z dS )� N)�*)�Node� )�Callablec C s t | t�S �N)� isinstancer )�c� r � /shortcuts.py�<lambda> � r c C sx t d�g}| dk }|r |�| � |D ]"\}}|�t d�|t d�|f� q$|dk rb|�t d�|f� |�t d�� t|� S )a& CASE statement builder. Example CASE statements: SELECT foo, CASE WHEN foo = 1 THEN "one" WHEN foo = 2 THEN "two" ELSE "?" END -- will be in column named "case" in postgres -- FROM bar; -- equivalent to above -- SELECT foo, CASE foo WHEN 1 THEN "one" WHEN 2 THEN "two" ELSE "?" END Corresponding peewee: # No predicate, use expressions. Bar.select(Bar.foo, case(None, ( (Bar.foo == 1, "one"), (Bar.foo == 2, "two")), "?")) # Predicate, will test for equality. Bar.select(Bar.foo, case(Bar.foo, ( (1, "one"), (2, "two")), "?")) ZCASENZWHENZTHEN�ELSEZEND)�SQL�append�extend�Clause)Z predicateZexpression_tuples�defaultZclausesZsimple_case�expr�valuer r r �case s " r c C s t �t| td| ���S )NzAS %s)�fnZCASTr r )ZnodeZas_typer r r �cast<