Couchbase (ver. >=5): How to create user using only N1QL - couchbase

I'm aware of other, well documented methods of user managing like WebUI, CLI tools, API POST.. What I actually need is to have ability to create user only by issuing N1QL statement. I can't find such chapter under documentation or so. This leads me to confusion: is it possible at all? From other hand, I've found some code snippets where user is being create, but this is not too clear to me. Any help would be much appreciate.
Cheers.

You need to use one of the options mentioned by you to create/drop users . There is no N1QL statement. You can use N1QL grant/revoke roles https://docs.couchbase.com/server/6.0/n1ql/n1ql-language-reference/grant.html

Related

MYSQL: How can I gain security at row-level?

I'm working on a project that involves researching about how to gain fine-grained access control (FGAC) in MYSQL database.
From my searching, I think that FGAC related to security at the row-level in MySQL. However, I've looked through many websites but I can only see one method which is using VIEW in MySQL.
Reference: https://www.sqlmaestro.com/resources/all/row_level_security_mysql/
I think there are still a lot of other methods to gain row-level access control, am i right?
Can anyone show me other methods as if there is only one method, it would be very little for me to write on my document.
Ps: Any limitations related to that method is also valuable for me.
There are products (open source and commercial) that address these use cases. The area is known as dynamic data filtering or dynamic data masking. Data virtualization is also a technique that can achieve what you want.
Look into Informatica, Axiomatics, Denodo, and others

MySQL Alternative to Trigger on Select

For a project I am currently working on, I am required to use triggers to restrict users' access to a database. However, since there are no triggers on SELECT statements, I need to find some alternative method for adding restrictions before a SELECT statement is executed. Are there any alternatives to "Triggers on SELECT"? if so, what are they?
Note: This is an assignment, thus I cannot add the restrictions at application level since the point of the assignment is to add restrictions at the DB Level.
I have also read all other posts that I can find on this, please don't close this post pointing me to some other related posts unless they have several alternatives I can choose from. I'm not saying these posts are of no use or the solutions are not proper, However, I would like to explore all of the possible solutions.
One solution is to change the table to a view, such that querying the view invokes a stored function, and the stored function logs access to the table.
Here's a blog by the great Roland Bouman, describing the process in detail:
http://rpbouman.blogspot.com/2005/08/mysql-create-dirty-little-tricker-for.html

mysql select query selects any depth

See the image below,say if i i/p z,i need to get o/p as x.
This is used to find parents and grand parents.
Can i do this using Mysql.
Any help in this would be appreciated.
Can this be done using facebook fql
You can use the user_relationships permissions on facebook to retrieve information about a users family. However this requires the user to actually define people as their family members. Here is a link to the permissions page. Once you have determined which permissions you need, you can read here and learn how to implement the permission dialog into your application.
Hierarchies are complicated in MySQL. I don't think you can store a bunch of custom stuff in fql so you probably can't do it that way unless it's a built in feature.
Here's an article about MySQL hierarchies:
http://www.phpro.org/tutorials/Managing-Hierarchical-Data-with-PHP-and-MySQL.html
See also this question with good answers:
Hierarchical Data in MySQL
There are even books written on the subject:
http://www.amazon.com/Hierarchies-Smarties-Kaufmann-Management-Systems/dp/1558609202
Complicated, but doable.

documentation, pointers on TMyTable.Open in MyDAC

I am learning Devart's mydac Data Access Components and I have few question I have not been able to resolve through online searches and the documentations. In the code examples, I see invocation of TMyTable.Open but I could not find the description in TMyTable class or its inheritance path. I would like to as if anyone can point me to the documentation of this method and whether it has any relationship to TDBGrid class.
Thanks in advance
TDataSet.Open is generally used to get a data cursor back from the database.
In order to use a TDBGrid you need to connect it to the TDataSet (In your case a TMyTable) through a TDataSource.
On the other hand TMyTable.Execute will only run your SQL code on the server and not retrieve any data (except for some info on the affected rows).
You normally use Execute for INSERT, DELETE, UPDATE, etc and Open for SELECT statements.
In my case, a F1 keystroke while the caret is over a SQLQuery1.Open; brings the help in the DB.TDataSet.Open article, which in turn gave me a (broken) link to the current DocWiki Page. Far from perfect, but good enough to get basic information.
http://docwiki.embarcadero.com/VCL/en/DB.TDataSet.Open

Nhibernate mapping tool for MySQL

Is there any mapping tool for nhibernate-mysql? I want a mapping tool that
Takes in a MySQL database
General the relevant hbm.xml file
Create the data access layer class that maps to each table.
Is there any such tools available?
There is only one tool similar to what you describe which is called ActiveWriter which is a VStudio addon. It is useful but have some serious limitations.
I would consider using NHibernate Fluent or ActiveRecords instead.
This popped up on the NHibernate users group some time back. General feeling was that it's a bag of hurt generating hbm.xml from database. Better to write classes and XML files.
One guy suggested MyGeneration, which might be worth a look.
CodeSmith has such a tool available.