Major 2025 Update: PostgreSQL now recommends identity columns over serial types. Drizzle has fully embraced this change.
import { pgTable, integer, text, timestamp, varchar } from 'drizzle-orm/pg-core';| using Infrastructure.Database; | |
| using Microsoft.EntityFrameworkCore; | |
| namespace Infrastructure.Authorization; | |
| internal sealed class PermissionProvider (ApplicationDbContext context) | |
| { | |
| public async Task<HashSet<string>> GetForUserIdAsync(Guid userId) | |
| { |
| ****DEPENDENCIAS**** | |
| 1. **Spring Boot Starter Web** (`spring-boot-starter-web`): | |
| - Proporciona anotaciones como `@ControllerAdvice`, `@ExceptionHandler`, `@ResponseStatus` | |
| - Incluye soporte para REST controllers y manejo de HTTP | |
| 2. **Lombok** (`lombok`): | |
| MIT License | |
| Copyright (c) 2022-present, cayter | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
Major 2025 Update: PostgreSQL now recommends identity columns over serial types. Drizzle has fully embraced this change.
import { pgTable, integer, text, timestamp, varchar } from 'drizzle-orm/pg-core';Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".
Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).
Let's dig in:
Pytest is a powerful Python testing framework that is widely used for unit testing, integration testing, and functional testing. This guide will take you step by step from basic to advanced features of Pytest, providing a comprehensive understanding of its capabilities.
This document is a reference for common testing patterns in a Django/Python project using Pytest.
Contents:
| from alembic import config | |
| from alembic import script | |
| from alembic.runtime import migration | |
| import sqlalchemy | |
| import exceptions | |
| engine = sqlalchemy.create_engine(DATABASE_URL) | |
| alembic_cfg = config.Config('alembic.ini') |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
Hello software developers,
Please check your code to ensure you're not making one of the following mistakes related to cryptography.