Skip to content

Instantly share code, notes, and snippets.

View adrianschneider94's full-sized avatar

Adrian Schneider adrianschneider94

View GitHub Profile
@adrianschneider94
adrianschneider94 / migration.py
Last active July 16, 2024 13:43
Usage of postgresql-audit with alembic/alembic-utils
"""Added postgresql-audit
Revision ID: bb4c40ff8edd
Revises: 771a56f4f9ec
Create Date: 2024-05-08 13:03:23.581216
"""
from alembic import op
# revision identifiers, used by Alembic.
@adrianschneider94
adrianschneider94 / eager.py
Created October 13, 2020 12:39
Load data smarter with graphene-sqlalchemy
from graphene.utils.str_converters import to_snake_case
from graphql.utils.ast_to_dict import ast_to_dict
from sqlalchemy.orm import ColumnProperty, Query, RelationshipProperty, joinedload, lazyload, load_only, selectinload, \
subqueryload
def collect_fields(node, fragments):
"""Recursively collects fields from the AST
Args:
node (dict): A node in the AST
@adrianschneider94
adrianschneider94 / docker-compose.yml
Created March 11, 2020 19:00
Docker-compose file to demonstrate the (tentative) failure of JGroups in Keycloak 9.0.0
version: '3'
volumes:
postgres_data:
driver: local
services:
postgres:
image: postgres
environment:
@adrianschneider94
adrianschneider94 / codegen.yml
Last active July 12, 2021 01:37
Current state of my graphql-codegen plugin for graphene.No pretty code yet.
overwrite: true
schema: "test.graphql"
documents: null
generates:
generated/test.py:
plugins:
- "lib/graphql-codegen-graphene.js"