I want to know the sync principle of logstash-input-jdbc?
I know it is based on the time compare method like :
select
*
from
cc
where cc.modified_at > :sql_last_value,
Does it also based on database trigger methon.
When I grep the logstash-input-jdbc source, I find there is no any trigger information.
If you know, please help me.
Any help would be sincerely appreciate.
Related
I need to log every changes through the application. Every changes will be connected to specific user, but connection can be null as well (add new item by remote API).
Let's imagine that some user adds new item. Here my problem starts... :) I don't know, how to store it properly and also don't know right solution. My ideas:
1 MySQL record
id(bigint), created_at(timestamp), user(int), changes(json?/or something else?)
JSON would be like:
{
table_name: 'item_name',
id_item: 1,
note: '' // optional
}
I don't know if this method is right for this use case. When I am writing this, I am thinking about id as uuid not int. Could it be?
2 JSON
Save record by record to the json file and after some size create new one. Records would be the similar structure.
I really don't know what method is the best for this use case. I'll be appreciate for a bit help. Thank you. Have a nice day. ;)
What you are describing sounds similar to functionality provided by temporal tables, a feature built into recent versions of MariaDB. You may want to look into that before you start inventing your own audit logging.
I have a view - 'test.view', I would like to know at least the last 10 updates to this view.
Any help appreciated
Hope someone can help me how to set-up an ERD diagram where you can store calculation methods or formulas.
The user should be able to add accounts:
eg
"points possible"; "ID: 1"
"points earned"; "ID: 2"
but should be also able to enter and keep a calculation out of it eg. score%
which is
"points earned"/"points possible"
or "ID:2 / ID:1"
Here's an example how this is being implemented in salesforce.com
Thanks
MySQL might look like a nice formula interpreter, but do not try taking user's input as a MySQL- Command. You must interpret the user's input, otherwise very powerful things are in users hands.
So the work of parsing the user's input is on the side of the program, not the MySQL.
How you store those data needs just a few facts about what you want to store. The user gives himself points and might calculate something out of these points? Are you sure you want to implement "calc.exe" again? ;-) Without an example plan and the point where you stall nobody can help you.
I sincerely apologize if this sounds like the most ridiculously beginner question, but I'm just starting to figure out SQL. It's more out of necessity than learning from the ground up. Thankyou for any help though, I sincerely appreciate it!
What I'm trying to do is create a script to insert data to the following table:
playercreateinfo_item.sql - github link to copy of the sql table
The fields/columns are race, class, itemid, amount.
How would I go about creating a script for this? From my basic understanding, it would be something like:
INSERT INTO playercreateinfo_item (race,class,itemid,amount)
VALUES (1,1,1,1);
But what else would I need? Like a header or footer? I'm honestly not even sure what a full script would look like for this! I also have to insert hundreds of different pieces of data, I'm not sure if there's an easy way to do it, or if I have to just do it manually. I'm so sorry if this is a horribly basic question, I'm just lost trying to learn. Thankyou so much in advance for any help! You guys are fantastic.
A SQL script is just a text file with SQL commands. Usually queries are separated with a semicolon.
No header or footer required.
Edit:
In case of inserting multiple tuples, you can do a batch insert with INSERT like this
INSERT INTO playercreateinfo_item (race,class,itemid,amount)
VALUES (1,1,1,1), (2,2,2,2), (3,3,3,3);
Guys I am developing my project in Mysql Workbench and have a confusion about my project.
I have few questions:
How do we manage different types of payments?
I mean my DB has a payment table and my system has 3 modes for payment.
1]Credit Card(Will store the respective information)
2]DebitCard(Will store the respective information)
3]Cash on Delivery(the payment is done in cash and will be updated later)
I have uploaded a image here to tell you what I was thinking
Bill table-Consists of bill generation and stuff.
Payment table-As to when the payment is done (I have added a type id and fks from all table so that I can use a if/else clause on the select method.) is this good practive?
Home table- is the cash on delivery thong
Is there any better method to do this? Please help.
I have further modified the image and have chucked out the type condition and instead I am using the if(payment_type) clause to access the respective DB, I believe this should get the job done. Is there any fault in this? Please help
Indeed. There is. I would go with inheritance.
Here a simple diagram:
You need to include your attributes and notations (oneTOone, manyTOone,...). Do some research for inheritance.
Look here: http://de.scribd.com/doc/7122945/ER-Diagram
And there are more if you google or stackoverflowle.
Regards ;-)