Skip to content
New issue

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

ISPN-14278 fix erros in the SQL store examples #10434

Merged
merged 2 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ include::dependencies_maven/persistence_sql_store.xml[]
.Declarative
[source,xml,options="nowrap",subs=attributes+,role="primary"]
----
query-jdbc-store xmlns="urn:infinispan:config:store:jdbc:{schemaversion}"
query-jdbc-store xmlns="urn:infinispan:config:store:sql:{schemaversion}"
----
+
.Programmatic
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example
package com.example;

enum Sex {
FEMALE = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ This section provides an example configuration for a SQL query cache store that
[discrete]
== SQL statements

SQL data definition language (DDL) statements for the "person" and "address" tables are as follows:
The following examples show SQL data definition language (DDL) statements for the "person" and "address" tables.
The data types described in the example are only valid for PostgreSQL database.

.SQL statement for the "person" table
[source,proto,options="nowrap",subs=attributes+,role="primary"]
Expand Down
2 changes: 1 addition & 1 deletion documentation/src/main/asciidoc/topics/sql/person.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CREATE TABLE Person (
name VARCHAR(255) NOT NULL,
picture VARBINARY(255),
picture BYTEA,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't that simple. Unfortunately, it depends upon the DB that is being used. VARBINARY(255) is more popular than BYTEA as that is only Postgres. I am not sure which DB you are trying to tailor the docs to.

https://github.com/infinispan/infinispan/blob/main/persistence/sql/src/test/java/org/infinispan/persistence/sql/AbstractSQLStoreFunctionalTest.java#L393-L401

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see! I added a note that it's valid only for PostgreSQL

sex VARCHAR(255),
birthdate TIMESTAMP,
accepted_tos BOOLEAN,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<distributed-cache>
<persistence>
<query-jdbc-store xmlns="urn:infinispan:config:store:jdbc:{schemaversion}"
<connection-pool connection-url=""/>
<query-jdbc-store xmlns="urn:infinispan:config:store:sql:{schemaversion}"
dialect="POSTGRES"
shared="true">
<queries key-columns="name">
Expand Down