Skip to content
Snippets Groups Projects
Verified Commit d533d172 authored by Martin Weise's avatar Martin Weise
Browse files

Hotfix the search service

parent 9099d926
No related branches found
No related tags found
2 merge requests!277Dev,!275Dev
No preview for this file type
No preview for this file type
......@@ -226,9 +226,14 @@ public interface MariaDbMapper {
/* null expressions */
.append(column.getNullAllowed() != null && column.getNullAllowed() ? " NULL" : " NOT NULL")
/* default expressions */
.append(data.getNeedSequence() && column.getName().equals("id") ? " DEFAULT NEXTVAL(`" + tableCreateDtoToSequenceName(data) + "`)" : "")
/* comments */
.append(!column.getDescription().isEmpty() ? (" COMMENT \"" + column.getDescription() + "\"") : "");
.append(data.getNeedSequence() && column.getName().equals("id") ? " DEFAULT NEXTVAL(`" + tableCreateDtoToSequenceName(data) + "`)" : "");
if (column.getDescription() != null && !column.getDescription().isEmpty()) {
/* comments */
stringBuilder.append(" COMMENT \"")
.append(column.getDescription())
.append("\"");
}
}
/* create primary key index */
stringBuilder.append(", PRIMARY KEY (")
......
......@@ -18,7 +18,7 @@ import lombok.extern.jackson.Jacksonized;
@ToString
public class ImportCsvDto {
@NotBlank(message = "location is required")
@NotBlank
@Schema(example = "file.csv")
private String location;
......
No preview for this file type
No preview for this file type
all:
all: build
clean:
rm -rf ./python/dist/* ./docs/build/* ./dist/*
......
......@@ -61,14 +61,13 @@ class RestClient:
if headers is not None:
logging.debug(f'headers: {headers}')
if payload is not None:
logging.debug(f'payload: {payload}')
payload = payload.model_dump_json()
logging.debug(f'payload: {payload.model_dump()}')
if self.username is not None and self.password is not None:
logging.debug(f'username: {self.username}, password: (hidden)')
return requests.request(method=method, url=url, auth=(self.username, self.password), verify=self.secure,
json=payload, headers=headers, params=params, stream=stream)
return requests.request(method=method, url=url, verify=self.secure, json=payload, headers=headers,
params=params, stream=stream)
json=payload.model_dump(), headers=headers, params=params, stream=stream)
return requests.request(method=method, url=url, verify=self.secure, json=payload.model_dump(),
headers=headers, params=params, stream=stream)
def upload(self, file_path: str) -> str:
"""
......@@ -767,9 +766,9 @@ class RestClient:
f'Failed to insert table data: response code: {response.status_code} is not 202 (ACCEPTED)')
def import_table_data(self, database_id: int, table_id: int, separator: str, file_path: str,
quote: str = None, skip_lines: int = None, false_encoding: str = None,
quote: str = None, skip_lines: int = 0, false_encoding: str = None,
true_encoding: str = None, null_encoding: str = None,
line_encoding: str = None) -> None:
line_encoding: str = "\r\n") -> None:
"""
Import a csv dataset from a file into a table in a database with given database id and table id.
......@@ -778,10 +777,10 @@ class RestClient:
:param separator: The csv column separator.
:param file_path: The path of the file that is imported on the storage service.
:param quote: The column data quotation character. Optional.
:param skip_lines: The number of lines to skip. Optional.
:param skip_lines: The number of lines to skip. Optional. Default: 0.
:param false_encoding: The encoding of boolean false. Optional.
:param true_encoding: The encoding of boolean true. Optional.
:param null_encoding: The encoding of null. Optional. Default: empty string "".
:param null_encoding: The encoding of null. Optional.
:param line_encoding: The encoding of the line termination. Optional. Default: CR (Windows).
:raises ResponseCodeError: If something went wrong with the insert.
......
......@@ -499,7 +499,6 @@ class CreateTable(BaseModel):
class CreateTableColumn(BaseModel):
name: str
type: ColumnType
primary_key: bool
null_allowed: bool
index_length: Optional[int] = None
size: Optional[int] = None
......@@ -993,8 +992,12 @@ class CreateForeignKey(BaseModel):
on_delete: Optional[str] = None
class PrimaryKey(BaseModel):
pkid: int
class Constraints(BaseModel):
uniques: List[Unique]
foreign_keys: List[ForeignKey]
checks: List[str]
primary_key: List[str]
primary_key: List[PrimaryKey]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment