Supabase check whether a user is currently in/listening to a realtime channel from postgres function - supabase

How can one, from a postgres function, check whether a user is currently in/listening to a realtime channel?
I want to create notification entries in the database only if the user is not currently online.

Related

How to run laravel queue jobs in multiple databases?

I have multiple databases in my project based on company we are giving new database for that company.i am developing automation workflows in my current project for that i was planned to implemented queue-jobs concept to achieve this one.
we are maintaining one more database which will contain all databases list (companies which are using them).i was little confused how to approach these kind of scenarios,either i have to maintain jobs table in my commonDatabase or if i have to create jobs table inside each database separately.
Note:- EVery time user tried to login he has to give company name(All requests we are sending in headers) that indicates database name.
My doubts are:-
i created jobs table in each database but it's not inserting records
in particular database,instead of it's inserting in commonDatabase
jobs table?
what is the best way to acheive this kind of scenario ?
if any user logged out the queue will run background or not ?
The thing I understand from you question is that you want to covert your project to multi-tenant multi-database and every company will generate a request to build tenant for them. The answers of your question are following:
I created jobs table in each database but it's not inserting records in particular database,instead of it's inserting in commonDatabase jobs table?
I must said you to watch this youtube play list.
If the Job is related to a company process i.e. you want to process any company invoice email then you will dispatch job in company database and if job is related to commonDatabase i.e. you want to configure any company database then run migrations & seeder into it, then it should be dispatch in commonDatabase.
if any user logged out the queue will run background or not?
yes, the queue will still run in background because the queue worker run on server and it doesn't have any concern with login session or any other authentication medium. You must need to read following articles/threads
Official Laravel Doc on queue
How to setup laravel queue worker

Which oracle database user to use for creating tables, procedures, views, deleting those and insert into tables [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have to know which user have developer's roles and privileges, how to connect him to my pluggable database and allow him to create, delete, drop, insert into tables ,create and drop procedures/functions/views .
and in my connection in my app jdbc which user can i use.
Is this your database, and by that I mean, did YOU create it?
Then the answer is, you need to create at least one schema for your application, and maybe perhaps as many as three.
Is this someone else's database? If so, they should give you credentials for the account you are meant to use.
Assuming this is a database you yourself just created, it's very important that you do NOT use these default admin accounts for you to do your application work in:
SYSTEM
SYS
Instead, use these accounts to create a user for your application.
Note that this USER will be able to do anything it wants to any object it owns (the SCHEMA).
For this reason, you often find this sort of layout for applications in an Oracle Database:
a schema for the application data (tables, views, materialized views)
a schema for the application code (PL/SQL and maybe stored Java procedures)
a schema for the application user
NO ONE gets to login as the application schema.
The stored procedures in the second schema are only given the privs absolutely necessary to do their job - READ/SELECT on a table perhaps, but not INSERT or UPDATE if it's just a proc to get data back.
The 3rd schema is only given execute privs on the 2nd schema.
If you create a user, they can do any/all of the things you mention -
create, delete, drop, insert into tables ,create and drop
procedures/functions/views
But they won't be able to do anything to objects/data in another schema unless you grant them the ability to do so. And in most cases, you would NOT do so. You'd write a PL/SQL API that does this work, and then grant execute privs on this API to your APP user.

Unlock Netsuite Records for Administrators

I'm using an ETL pipeline to read Transaction data from Netsuite into my data warehouse. I get the following message when I try to load the data:
RCRD_LOCKED_BY_WF: This record has been locked by a user defined workflow.
I do have an active workflow that locks some Transaction records. My question is: is there a way to allow certain users (in my case, an administrative user) to read locked Netsuite records via the API?
Set a Condition on the Lock Record Action so that it does not run when Administrators (and any other Roles you wish) interact with the record. Or change the Context in which the Lock Record Action runs so that it only runs in the User Interface, for instance.

check if update is from oracle database user or from external application on database

Dears
I have an Oracle Trigger that Updates a Column named ChangeBY.
this trigger is fired when a user updates any record inside the database and places the username in the ChangeBY column.
The Updates are done from both sides, It can be an update directly from a database user or it can be from an external application connected to my database.
how can I check from where is the Update Coming? From database User or Application?
I want to put a condition inside the trigger to only run my code when any update on values is made ONLY FROM A DATABASE USER since connected applications changes the ChangeBY Column Automatically.
Is this Possible?
Thank you,
I am litle bit confused about database user and application user. Since any application that might connect will internally use a database user only for update. You can check the current user who is logged in and trying to update
.
May be u can explain lil bit about ur application user.

Managing Active Directory from Oracle

I have a database in oracle, my task is to create/update a user in Microsoft Active directory running on different server, when a user detail is entered / updated in Oracle table.
If its not possible then what is the best way to achieve this.
Currently we are doing it by running a code written in C# which reads from oracle and does job in AD, it triggers from user creation package but some times triggering fails and whole process fails. User details are updated in DB but not in AD.
Oracle is running at different server. User details are entered in DB through a different package.

Resources