@enterprise_search/indexing_mysql
v0.8.62
Published
indexing data in mysql
Downloads
3,325
Readme
mysql-index:
type: mysql
scan:
sql: `SELECT * FROM person where last_updated > {sinceDate}` # Note the templating. If ignored always same
connection:
host: localhost
port: 3306 # defaults to this anyway
user: someName
password: env variable name of password
database: test
For testing mysql
CREATE DATABASE test;
USE test;
CREATE TABLE person (
id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL,
date_of_birth DATE,
last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('John', 'Doe', '[email protected]', '1980-01-01');
INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('Jane', 'Smith', '[email protected]', '1990-02-15');
INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('Michael', 'Johnson', '[email protected]', '1985-05-30');
INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('Emily', 'Davis', '[email protected]', '1992-07-22');
INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('William', 'Brown', '[email protected]', '1975-12-05');
INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('Jessica', 'Williams', '[email protected]', '1988-11-10');
INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('David', 'Jones', '[email protected]', '1995-03-14');
INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('Sophia', 'Garcia', '[email protected]', '1993-09-08');
INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('James', 'Martinez', '[email protected]', '1982-06-25');
INSERT INTO person (first_name, last_name, email, date_of_birth)
VALUES ('Olivia', 'Hernandez', '[email protected]', '1991-01-20');