Skip to content

Instantly share code, notes, and snippets.

View ZeroICQ's full-sized avatar
🤖
Working from home

Alexey Mogilyovkin ZeroICQ

🤖
Working from home
View GitHub Profile
version: '3'
services:
db:
image: postgres:14
volumes:
- ./db:/var/lib/postgresql/data
ports:
- "15432:5432"
environment:
#!/bin/bash
export PGPASSWORD="password"
today=$(date +"%Y%m%d")
pg_dump -vvv -h localhost -p 15432 -U user db_name > dumps/dump_${today}_local.sql
printf "wrote to %s\n" dumps/dump_${today}_local.sql
@ZeroICQ
ZeroICQ / property_inheritance.md
Created May 3, 2021 06:00 — forked from Susensio/property_inheritance.md
Inherit property setter in python 3.7

Python @property inheritance the right way

Given a Parent class with value property, Child can inherit and overload the property while accessing Parent property getter and setter.

Although we could just reimplement the Child.value property logic completely without using Parent.value whatsover, this would violate the DRY principle and, more important, it wouldn't allow for proper multiple inheritance (as show in the example property_inheritance.py bellow).

Two options:

  • Child redefines value property completely, both getter and setter.

Final report for GSoC 2019 with MariaDB

Student: Alexey Mogilyovkin
GitHub: @ZeroICQ
Organization: MariaDB
Project Title: Add support for Indexes on Expressions

About

My task was to add support for indexes on expression. At the very beginning it was split into two steps:

  1. Add expression matching into the optimizer, use it for generated columns. So the following request should work and use index
CREATE TABLE t1 (a int, b int, INDEX (a/2+b));