PhalconPHP: I have an error in create model by devtools - command-line

I'm using windows and my table name is "products"!
Command:
phalcon create-model --table-name products
Error:
Error: Unknow parameter 'table-name'
What is the problem?!

It must be:
phalcon model --name products
Or:
phalcon model products
If you need to check what options are available in certain command, type:
phalcon model

Related

How to generate Entity-context only for one schema when multiple schema available in one database in Postgres sql with .Net Core?

I am using the Postgres database for my project and have created 3 schemas named mydb_dev, mydb_stage, and mydb_prod in database 'temp_db'.
I am creating .Net core web application with the database first approach with entity framework.
Now, whenever I am trying to generate an entity model from the database it generates for all 3 databases. And I want to generate only one database that is mydb_dev.
I am using the following command to generate through the console.
Scaffold-DbContext "Host=localhost;Database=temp_db;Username=myuser;Password=mypassword" Npgsql.EntityFrameworkCore.PostgreSQL -o Models
Is there any way to generate an entity model only for one schema?
If you check the documentation: https://learn.microsoft.com/en-us/ef/core/miscellaneous/cli/powershell#scaffold-dbcontext
Scaffold-DbContext has a -Schemas <String[]> parameter.
The schemas of tables to generate entity types for. If this parameter
is omitted, all schemas are included.
So your command should look like this:
Scaffold-DbContext "Host=localhost;Database=temp_db;Username=myuser;Password=mypassword" Npgsql.EntityFrameworkCore.PostgreSQL -o Models -Schemas "mydb_dev"

Split database in magento-2.3.3 at localhost

I have tried to split magento databases. I have tried following things.
create database magento_quote;
GRANT ALL ON magento_quote.* TO magento_quote#localhost IDENTIFIED BY 'magento_quote';
create database magento_sales;
GRANT ALL ON magento_sales.* TO magento_sales#localhost IDENTIFIED BY 'magento_sales';
When I am running the following command I am getting error like
Command "setup:db-schema:split-quote" is not defined.
php bin/magento setup:db-schema:split-quote --host="127.0.0.1" --dbname="magento_quote" --username="magento_quote" --password="magento_quote

Datagrip - PostgreSQL connection to Heroku not showing tables

I connected to my Heroku PostgreSQL database with Jetbrains Datagrip. Authentication was successful, I didn't need to specify advantage properties when connecting, when I filled host, db, username and password, Test connection was successful.
When I write query to console, everything works, for example:
SELECT * FROM users
find all users in my database.
I have problem, when I want to see tables in my database structure. They don't appear. In project tree, I can see only Database_name -> schemas -> public -> key_id_seq (image: Project tree structure). When I click on synchronize button, I get an error:
[42703] org.postgresql.util.PSQLException: ERROR: column t.relhasoids does not exist
Position: .
Error encountered when performing Introspect database *db_name* schema public (details): ERROR: column t.relhasoids does not exist
Position: .
ERROR: column t.relhasoids does not exist
Position:
Am I doing something wrong? Thank you.
Datagrip updated to version DataGrip 2019.3.3, Build #DB-193.6494.42, built on February 12, 2020, Now working :)
Try using "Introspect using JDBC metadata". This fixed it for me when (I think) I had a version mismatch between postgresql server and DataGrip client.
Under your connection settings -> Options tab -> check Introspect using JDBC metadata
According to https://www.jetbrains.com/help/datagrip/data-sources-and-drivers-dialog.html#optionsTab :
Switch to the JDBC-based introspector.
To retrieve information about database objects (DB metadata), DataGrip
uses the following introspectors:
A native introspector (might be unavailable for certain DBMS). The
native introspector uses DBMS-specific tables and views as a source of
metadata. It can retrieve DBMS-specific details and produce a more
precise picture of database objects.
A JDBC-based introspector (available for all the DBMS). The JDBC-based
introspector uses the metadata provided by the JDBC driver. It can
retrieve only standard information about database objects and their
properties.
Consider using the JDBC-based intorspector when the native
introspector fails or is not available.
The native introspector can fail, when your database server version is
older than the minimum version supported by DataGrip.
You can try to switch to the JDBC-based introspector to fix problems
with retrieving the database structure information from your database.
For example, when the schemas that exist in your database or database
objects below the schema level are not shown in the Database tool
window.
My case was different here. But I was getting the similar error:
An error has occurred:
01:15:21 PM: Error: ERROR: column rel.relhasoids does not exist
LINE 1: ...t_userbyid(rel.relowner) AS relowner, rel.relacl, rel.relhas...
I was using pgadmin 3 to connect to Heroku hosted Postgresql. Then I configure pgadmin 4. The error didn't show on it. For installing pgadmin 4, I used docker approach.
docker pull dpage/pgadmin4
docker run -p 5050:80 -e "PGADMIN_DEFAULT_EMAIL=XXXX#Xmail.com" -e "PGADMIN_DEFAULT_PASSWORD=thirumal" -d dpage/pgadmin4
Now, open the browser and navigate http://localhost:5050/.

db2fs shows exception TypeError: netscape.security.PrivilegeManager is undefined

After successfully installing IBM DB2 Express V10.5_01 on an Ubuntu 14.04 LTS machine I tried to follow the next step and start
db2fs
in an X-Windows session. I am asked to create a profile for firefox and a browser window comes up with an error message dialog showing
exception TypeError: netscape.security.PrivilegeManager is undefined
When pressing ok for a few times the "create sample database" button disappears and instead a warning appears:
First Steps was unable to connect to the online DB2 Information Center and could not find an instance of a locally installed DB2 Information Center for this version of the product. To access product information, one of the following types of connections to a DB2 Information Center is required:
Internet access to the online DB2 Information Center
A locally installed version of the DB2 Information Center
Access to a remotely configured DB2 Information Center
As a workaround I tried to use
db2sampl
after adding my user to the groups dasadm1 db2iadm1 and db2fadm1 that had been created by the installation procedure.
db2sampl -force
Creating database "SAMPLE"...
Existing "SAMPLE" database found...
Dropping and recreating database "SAMPLE"...
Attempt to drop existing database "SAMPLE" failed.
Attempt to create the database "SAMPLE" failed.
SQL1013N The database alias name or database name "SAMPLE " could not be
found. SQLSTATE=42705
db2 list db directory
shows:
Database alias = SAMPLE
Database name = SAMPLE
Local database directory = <path>/db2inst1
Database release level = 10.00
Comment =
Directory entry type = Indirect
Catalog database partition number = -1
Alternate server hostname =
Alternate server port number =
unfortunately
db2cc
is not available anymore as an admin tool in V10.5 see DB2 Express V10.1 and db2cc binary and before downloading
IBM Data Studio I'd first like to check the basic integrity of my installation.
db2help
e.g. gives the errormessage
/bin/sh: 0: Illegal option -p
In all I have the feeling that Ubuntu 14.04 LTS is not a properyly supported platform for IBM DB2 Express V10.5_01.
How feasible is it to get IBM DB2 Express V10.5_01 running in this environment?

How can i check the template for postgis in postgres ubuntu

I am following this tutorial
http://technobytz.com/install-postgis-postgresql-9-3-ubuntu.html
and i created db with this command
createdb test_db -T template_postgis2.1
but i get this error
test_db2=# select postgis_version();
ERROR: function postgis_version() does not exist
LINE 1: select postgis_version();
This works if use
create extension postgis
i want to know that is that ok or i have error. because i made the template before. Didn't that template automatically make the db as postgis
According to the official documentation on the topic, you have to create the extension in each new database you create. Why? This has to do with a change in the way a database is PostGIS-enabled in PostgreSQL-9.1+ and PostGIS-2+. Previously, there were a series of scripts that had to be run to load the functions, types, and other features of PostGIS into a database. Consequently, the best practice was to create a template database (template_postgis, etc.), run all the scripts against that template, and create each new PostGIS-enabled database against that template. In newer versions of PostgreSQL (9.1+), you can enabled PostGIS support within a new database by simply executing the command CREATE EXTENSION postgis; as such, you should skip the template step entirely.
So to sum up:
CREATE EXTENSION postgis; is the way to go for PostgreSQL-9.1+ and PostGIS-2+
Making a template database is the way to go for prior versions of PostgreSQL or PostGIS.
I hope that helps clear it up!