ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I need to write a program in C/nCurses for my dad. It needs a database back end. There are two requirements that I need some form of database backend for.
Requirements: ( 0 )
0. Store a category.
1. Store liquor lines.
2. Store the units for each line.
3. Store the cases and costs for each unit.
Eg.
Beer -< Category
Victoria Bitter <- Liquor Line
375ml stubby <- Unit type
24pk <- Case type
6pk <- Case type
800mls <- Unit type
18pk <- Case type
Requirements: ( 1 )
0. Account / Customer Details. ( same thing )
1. Invoice report for some Account / Customer
So basically it's two databases, and 4 tables for the first one and 2 for the second one. I've done stuff like this before in SQL so I'm used to SQL style but I can figure out any database language.
I did write some low level file handling stuff for a subject in computer science, basically writing our records to pages and flushing pages out to binary, and writing some indexes for it. It was hard!
I don't wanna write all my own low level file handling, I need something to embed thats free software and good but I can't find anything except some experimental thing some university in some country is writing but there's no source code.
If you guys know any good stuff thats well documented I'd appreciate it. I gotta get this thing done ASAP my dad needs something fast.
Why embedded - how small is 'embedded' and what CPU?
A key/value database (like the sleepycat DB) is fairly small - but I get the impression you want a relational DB.
You can get x86-family or ARM processors that consume under 8W (12-15W with hard disks) and these have better specs than a top-of-line desktop from 8 years ago - definitely capable of running a relational database like PostGRESQL or MySQL (but check the project websites to see what CPUs they've been built and tested on). Given the rather steep price of these small boards for the embedded market, you may be better off buying a Mac Mini or the generic PC clone equivalent - that way you have a single warranty and a nice box.
The database is the easy part - making a nice friendly web interface is the tough part. My guess is 2 weeks solid work + testing and that's assuming you already know what you're doing and don't have to spend too much time reading.
Have a look at SQLite.
No seperate database server process or so. Just a library that will store your (multiple) tables and indexes in one binary file.
Open source, and avaibable as a package on most distributions.
I don't mean embedded as in it's on a small device.
Sorry I just googled and got the meaning of the term. It's not what I want.
I can use a separate database and write a C client with ncurses but I think it'd be easier if I could include a database library into the C program and do everything from within without starting up a database server.
Like #include <some database library>
I'm trying to avoid using a separate database server for it just 'cause but if thats the way to go then I can do that too.
The programs very basic so will be the UI it's going to run on a laptop.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.