jayvynl / django-clickhouse-backend

Django clickhouse database backend.
MIT License
130 stars 21 forks source link

[BUG] no-op with runSQL migrations #91

Closed nxmai closed 4 months ago

nxmai commented 4 months ago

Describe the bug I use migrations.runSQL() to perform some migrations that the ORM cannot support for clickhouse DB. And it not work. The migrations code in clickhouse_backend/patch/migrations.py does not include special migrations of Django (from django.db.migrations.operations.special) Is it a bug or you guys dont want to perform that action?

# Generated by Django 3.2.14 on 2024-07-11 12:49

from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('api', '0001'),
    ]

    operations = [
        migrations.RunSQL(
            'ALTER TABLE "event"  ADD COLUMN "record" String CODEC(ZSTD(6))'
        )
    ]

Versions

jayvynl commented 4 months ago

duplicate #15

nxmai commented 4 months ago

Do you have any way to decrease the memory, it use a lot of mem, I try to set connection pool lower but not affect

On Sat, Jul 13, 2024 at 9:25 AM jayvynl @.***> wrote:

duplicate #15 https://github.com/jayvynl/django-clickhouse-backend/issues/15

— Reply to this email directly, view it on GitHub https://github.com/jayvynl/django-clickhouse-backend/issues/91#issuecomment-2226725733, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALV2XBJYCTKH7VTQHQPE2ULZMCFYHAVCNFSM6AAAAABKYDAUAOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRWG4ZDKNZTGM . You are receiving this because you modified the open/close state.Message ID: @.***>

nxmai commented 4 months ago

one more question, when will you update the clickhouse-driver version to 0.2.8 I found the issue is because the date/date32 field in taking a lot of memory. cre: https://clickhouse-driver.readthedocs.io/en/latest/types.html#date-date32

On Tue, Aug 6, 2024 at 8:36 AM Mai Nguyễn @.***> wrote:

Do you have any way to decrease the memory, it use a lot of mem, I try to set connection pool lower but not affect

On Sat, Jul 13, 2024 at 9:25 AM jayvynl @.***> wrote:

duplicate #15 https://github.com/jayvynl/django-clickhouse-backend/issues/15

— Reply to this email directly, view it on GitHub https://github.com/jayvynl/django-clickhouse-backend/issues/91#issuecomment-2226725733, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALV2XBJYCTKH7VTQHQPE2ULZMCFYHAVCNFSM6AAAAABKYDAUAOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRWG4ZDKNZTGM . You are receiving this because you modified the open/close state.Message ID: @.***>

jayvynl commented 4 months ago

released as v1.3.0