Archive for the ‘Grid’ Category

Developing small Mac apps with MySQL

Январь 15th, 2010

Steve McConnell's great book What tool should I use to develop small MySQL end user applications on my Mac?

Let me start by saying that I don’t know the answer, and I’m looking for your guidance. To make my question more specific, let me describe my background and what I want.

I started my professional career in the 1980s as a developer using a tool called FOCUS by Information Builders. Terminology was different in those times. Focus was “a hierarchical database” and a “4GL“, which stood for “Fourth generation programming language“. Presumably, 4GLs saved lots of development time over the third generation, which wasn’t just COBOL (no, I never wrote a line of that) but also C. There was some truth to the claim, and I would still write faster reports in the rich TABLE FILE syntax than in MySQL’s (or any sequential database’s) SELECT syntax. But I can still do fine with plenty of different reporting packages, open source or closed, and get convenient and impressive reports out of MySQL.

What I am missing is the part for easy editing of the database tables (this was MODIFY FILE for the 0,5 % of you who know FOCUS). Sure, phpMyAdmin is fine, but it’s very generic and I’d like to have some control over what I was doing. Not to the degree that I would want to go to the, ehh, 3GLs of C, C++ or even Java. Nor do I need the app to be web aware: the data should be constantly available on the hard disk of my Mac, as the app I am looking to develop first is a time tracking application.

Yes, I have cut my hair since. Should have a new 'Kaj with Mac' pic taken!“Well, Kaj,” you may say, “buy, don’t build!”. And I would dearly love to find an Open Source app or even a commercial one that does the job. Thus, I googled and I found lots of reviews of excellent Time Tracker apps with fantastic UIs, none of which do what I want.

This should make my development tool search easier

  • the tool can be native for Mac OS X (it’s OK if it’s cross platform, though)
  • the tool doesn’t have to work in a browser (it’s OK if it does, though)
  • the app is local and single-user (no cloud, not even a web)
  • generic control of a limited amount of UI aspects is fine (nothing fancy)
  • for database support, MySQL is enough (it’s OK with others)
  • I’m willing to spend some time learning (if the tool makes me productive)

I have just three key requirements

  1. Easy grid format input and editing of many rows of a MySQL table
  2. Easy interfacing with the clipboard for cutting and pasting data to/from Google Docs and Spreadsheets
  3. Fairly easy background coding of command button triggers, executing SQL queries, mysqldumps and the like

I would basically need two screens in the app.

Input Screen:

  • some input boxes for asking selection criteria (e.g. start date, end date, project codes, search string)
  • an editable grid which I can fill with the output of a SELECT statement of my choice, auto-column-width on contents
  • some command buttons for triggering events (e.g. update, copy, paste, backup, calculate)
  • a loop construct where I can upon command-button click easily compare each row of the grid with what I had prefilled the grid cells with, and programmatically determine whether to launch a MySQL UPDATE, INSERT or DELETE

Output Screen:

  • similar constructs used to define the report
  • report can be executed and shown on a similar grid on the screen (with a LIMIT of the lines of output)
  • report can also be exported to the clipboard or to a text file or optionally even a PDF file

That’s it! I want to avoid spending time on any fancy distractions from the above — but what I have defined, I need to be able to do properly. If I’m lucky, this means I’ll enjoy some coding time again. I haven’t done it this century, and miss many aspects of what I did in the 1900’s with APL, Focus, Visual Basic, Delphi, and PHP.

Hints?


PlanetMySQL Voting: Vote UP / Vote DOWN