Extensible DB editor - mysql

I'm using MySQL.
In my DB there are several tables, containing fields with data, serialized in custom binary format. (Actually, these fields contain lists of fixed-format records, like a "sub-table".)
I need a tool to be able to edit those fields by hand while my own fancy data administration UI is still in development.
I wonder, if there is a DB viewer/editor (like PHPMyAdmin or Sequel Pro or whatever) which I would be able to easily extend to deserialize that extra data?
Note that the [de]serialization library is in plain C and I do not want to spend much time rewriting it in another language. (I would better spend that time on that data administration UI.)
Any clues?
P.S. I need the editor to work on OS X or Ubuntu (Wine is fine) or be web-based.

Sequel Pro is open source, so you can probably get the sources and hack your code in there.
Get it here.

This is a Java app http://www.isqlviewer.com/ . You could load your C library in that using JNI. I've used iSQLviewer a lot with various databases and the download comes with code, but I can't say I've ever looked at the code!

Related

MySql Workbench and Html Sublimetext 3

I have been writing SQL queries for a while now, but brand new to HTML.
I have been using Sublime text to code HTML and using Mysql - Workbench to code databases etc on local server.
I'm wondering..
How do I code HTML to return SQL queries onto a console (Google Chrome)? and connect the two together
I have searched all over google and You Tube, only thing I can find is something to do with PHP.. not sure what how it works, but don't think that is something I need.
All I want to do is create a text box inside HTML and input id value as an example 10 and return the id number along with the whole row from the database.
Using this query: select * from tableName where id = 10;
HTML is a document formatting language. While it supports JavaScript, said JavaScript is sandboxed in the browser: It cannot easily access files and the like even when that other stuff is running on the same computer as the browser. The main reason here is security. Imagine every web page on the Internet could look at every file on your disk, copy them or save new files on your disk or modify them.
So what you need is a "server software" of some kind. This software talks to the browser. It sends it all the HTML that the browser requests. The HTML can then ask for more (for example using JavaScript and AJAX). These requests go to the server which parses the parameters, collects the data (only the server talks to the database) and sends results back.
This is a pretty complicated and involved process. For this reason, everyone uses a framework to do it. The framework handles all the ugly stuff like converting query results from the database into the types and objects of the programming language and then again to HTML code which looks good.
Since you don't know any programming languages, yet, I suggest you start with Python. A good web framework for Python is called "Django". Django also contains modules to talk to databases. It also has many "widgets" like tables that display query results.
Google for "python django mysql" which should give you plenty of examples.

Is there any database system which I can use it without installation

I am designing a small program, which I want to use a database to manage my data. I want a database which I may put it into my system, so that users may use it without install any database system.
So is there any database suit for my project requirement?
Programming Language: Java
Platform: cross-platform (linux, windows, mac)
There are three reasons why I want to use an embedded database system
there is not too much information in my system
what I wish it user may directly to use my system without to setup any database
I also wish when I copy my system from computer A to computer B, it may keep all data
besides database, I also consider to manage data with XML file, but I don't think it is a good idea to use XML, because it is not easy to update or delete data.
AND this is my first time to use stackoverflow, so there are some culture I am not very clear. If I offended stackoverflow, please forgive me.
I use h2 in java.
For following scenario:
h2 is really small (about 1Mb), it is easy to copy, and easy to use with maven, gradle, etc.
h2 is pure java db, when I want to write unit test on my DAO java code, it is easy to start.
h2 can simulate oracle dialect、mysql dialect. After I built a demo with h2, it is easy to move all java code to work with a big DB system.
In H2 jdbc URL, it is easy to config a init SQL script in a file. By this feature, It is easy to create a clear database with only necessary data in it.
When you want to share your data, you can simply release your database file with your production, which is difficult for Oracle or MySQL.
Another real example is Atlassian Confluence. You may download and install Confluence, start it with h2 for trial. When you decide to use it in business, set it up to connect MySQL or Oracle.
SQLite is a common choice. You can embed the database core functionality as a library in your app. The only local resource required is plain vanilla files on the normal file system -- no drivers, daemons etc.

iOS and Mac OSX communicating with MySQL database

I have a client who wants a control panel for the app I am developing them. The control panel is a Mac OSX application that allows the user to submit files (excel docs and such) to my MySQL database. Those files are then checked by the iOS app I have created for them.
I have no idea how to do this. I have the MySQL database all set up, and I have looked everywhere for a solution. Any help is appreciated.
I wouldn't try to connect to your MySQL database directly from your cell phone. It's a bad design for several reasons. Instead build a API on the same server as the MySQL database. It doesn't matter if you do it in java, php, c# or anything else. You might even find some product or open source project that can do this automatically. I've listed some benefits of doing it this way
It makes testing easier. You can write a test framework against your API that doesn't rely on or is using a phone.
It makes development faster. You don't need to emulate or use a phone to develop and test your table design and queries.
It gives you compatibility. When you need to change your database (and you do) you can create new APIs that the new version of the app uses while and old version still out there can continue to use the old API (that you might have to modify to still provide the same functionallity)
It gives you flexibility. If your user base grows and you might need to have replication for reads or sharded databases you build that into the API instead of into the app which is just a better way to do it.
One option would be to use PHP to handle all the database interaction.
Host the scripts on the server and just have the apps call them and get the scripts to return some sort of parseable response (I'd go for JSON).
I have never found a suitable Object-C based connector for MySQL. At this point I would suggest using a C/C++ connector. There's lots of examples of how to configure the connector for both C and C++. The hard part will be all of the data passed from the MySQL code and the Object-C code will that it will have to be in C types.
EDIT: An Example

generate DBF files

How to generate DBF files with delphi?
More information:
I need a portable Database to run in a pendrive
I don't know if DBF is the better soluttion.
I like MySql but is hard to find a portable version
I am working with XML at this time but I don't know how to make a Query.
TDBF seems to be one of the most used (and still maintained) packages:
http://tdbf.sourceforge.net/
If you are open to alternative formats, I would strongly recommend you check out Firebird embedded. I'm pretty sure I loaded my database and my application on a flash drive as an experiment about two years ago and it ran fine. I stuck with DBF files for a long time, but once I made the switch, I would never go back. If you want to give this a try, consider using DBExpress and the Interbase driver. Although it's not officially supported, I have not found any incompatibilities. For a visual management tool, get the personal edition of IBExpert.
Not dealt with that in years!
Depending on your version of Delphi and what you want to do, you can either use the BDE or find some specialized components that read/write directly to DBF native file format.
Wow, I'm amazed this url is still valid!
If you want to create a DBF with the BDE API, you can use the techniques here:
http://info.borland.com/devsupport/bde/bdeapiex/dbicreatetable.html
However, depending on the size of the dataset you're going to have, this sounds like a single-user app, which would work just fine with a "MyBase" file -- another name for the files used by TClientDataSet. You can save it either as XML or binary (CDS) format by simply setting the TClientDataSet.FileName property, which will be used to read and write the dataset. You can even create nested datasets with this.
If you want to have the most efficient single user mode, also turn off the ChangeLog on the TClientDataSet.
procedure TFormCDSDataBug.ButtonOpenClick(Sender: TObject);
begin
ClientDataSet1.FileName := ExtractFilePath(Application.ExeName) + 'MyData.cds';
ClientDataSet1.LogChanges := False;
ClientDataSet1.Open;
end;
While I haven't used it, there is a component jdDbf which appears to be recently updated that appears that it will work. Something to be aware of is that the Dbf format has many flavors, however most of the variances appear to be in the index files so if you need to use it with another system you might have to rebuild them.
For a embedded database that works well on a usb drive, I would look at SQLite. There is a Delphi implementation DISQLite3 which has a free and pro version that would work well and comes highly recommended. There are many commercial quality programs currently using it, including the likes of FeedDemon.

Easy data conversion tool

I often have data in Excel or text that I need to get into SqlServer. I can use ODBC to query the Excel file and I can parse the text file. What I want though is some tool that will just grab the data and put it into tables with little / no effort. Does anyone know of such a tool?
Have you tried the SQL Server Import/Export Wizard ?
In SQL Server Management Studio, right-click your Database Name, and select Tasks menu, Import Data. For Data Source, select Microsoft Excel, browse to the .XLS...
If you are using Sql Server look at Integration Services (SSIS).
You can also take a look at parse-o-matic
Use DTS or SSIS depending on which version of SQL Server you have. There is an import wizard which can get you started, but data imports are rarely simple and usually involve some sort of data cleanup so that your incoming data is acceptable to the table where you intend to store it. Excel data, in my experience, is usually particularly bad inthis respect becasue it often isn't stored properly in Excel to begin with.
I haven't seen commercial tools that do this. I create this kind of tools at work all the time, and the data validation is not trivial. This just makes sure that you don't have bad data making it into your database.
I found that for simple data conversion needs something like FileHelpers is pretty good. It still needs programming though. This framework is fairly easy to use, and somebody with a little bit of experience could bang something out for you.
On further thought, you can use the SQL Server bcp utility to upload the contents of a text file. This is a command-line utility and has a lot of switches. I would suggest you experiment on a test table before you use this in a production table.
It's been a while since I used it, so I can't remember if you can directly use an Excel spreadsheet. Text files are always the easiest to deal with in any case.
Seems like it'd be pretty easy to write a script that reads the text file, and converts it to "INSERT * into TABLE" Sql statements. I suspect this has already been done, but a simple implementation would be less than 100 lines of code in your favorite scripting language.
Hey, Google says SQLServer comes with such a tool, BULK INSERT: