We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I need to execute INSERT query where some columns should be null. How can I do this?
My code example:
query = """ DECLARE $user_id AS String; DECLARE $tg_user_id AS String; DECLARE $activate_token AS String; DECLARE $notifications_enabled AS Bool; DECLARE $created_at AS Datetime; INSERT INTO tg_users (user_id, tg_user_id, activate_token, notifications_enabled, created_at) VALUES ($user_id, $tg_user_id, $activate_token, $notifications_enabled, $created_at); """ params = { "$user_id": (user_id.encode(), ydb.PrimitiveType.String), "$tg_user_id": None, # this column should be NULL "$activate_token": (activate_token.encode(), ydb.PrimitiveType.String), "$notifications_enabled": (notifications_enabled, ydb.PrimitiveType.Bool), "$created_at": (int(datetime.now().timestamp()), ydb.PrimitiveType.Datetime), } async with await self.tx.execute(query, params): pass
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I need to execute INSERT query where some columns should be null. How can I do this?
My code example:
The text was updated successfully, but these errors were encountered: