Osm Admin: ALTER TABLE. Non-NULL Data Conversion. Query Test Suite
2 years ago ∙ 5 minutes read
Implemented in Osm Admin:
- new ALTER TABLE algorithm
- NULL to non-NULL data conversion
- new query test suite
2 years ago ∙ 5 minutes read
Implemented in Osm Admin:
2 years ago ∙ 4 minutes read
This time, I tackled adding an explicit property to an existing table, and then making it non-nullable.
It raised the need for data conversions - additional handling of the existing data - or otherwise, the database engine fails, or the data becomes invalid.
And it made me split migrations in two parts - the one that runs before the data conversion, and the other one that runs afterwards.
2 years ago ∙ 3 minutes read
While working on diff algorithm I noticed a certain pattern that I use over an over again.
Using this pattern, I implemented notification table diff.
Finally, I rearranged diff/migration code for better code readability.
2 years ago ∙ 3 minutes read
Yesterday, I moved the table creation code into new schema diff migration engine.
Now, working on notification table migrations.
2 years ago ∙ 2 minutes read
This time:
2 years ago ∙ 1 minute read
Before digging into property diff algorithm, let's dig into how exactly it's used, and what other property-related logic is there.
2 years ago ∙ 2 minutes read
Yesterday, I continued working on schema migrations:
2 years ago ∙ 2 minutes read
After a system update, I've got some problem with my laptop, and one thing to check was system log files.
This got me thinking: what makes a good log for my own application? And I think that application logs are as useful as they are able to answer potential questions I may have when an application is in production.
Let's think what kind of questions I might have, and what information might be useful to answer them.
2 years ago ∙ 4 minutes read
Recently, I fixed numerous issues to make the first migration tests work.
Then, I started implementing the schema diff algorithm - the basis for schema migrations.
2 years ago ∙ 1 minute read
More dots got connected in the schema migration design, see this post for details.
Then, I tried to return to TDDing it, but strange errors met me there, so I left them to be resolved in the next piece.
2 years ago ∙ 2 minutes read
Schema migrations are going to be generated and executed automatically under gulp watch
. It will result in lots of tiny migrations: add a column, change its type, make it not nullable, and so on.
It's convenient during development, but it might be not optimal to reapply in production. Indeed, it's better to convert a large table to new structure all at once rather than running a conversion for each of the tiny migration.
This observation contradicts the previously stated migration workflow, so let's update it.
2 years ago ∙ 4 minutes read
In spirit of TDD, I started with a meaningful, but failing test that is reasonably fast. Then, I worked to make it green:
2 years ago ∙ 1 minute read
After drafting some ideas of how the schema migrations should actually work, let's start implementing it in TDD way.
2 years ago ∙ 3 minutes read
The goal of the current iteration is to adjust the database schema and preserve/convert existing data according to any changes in schema classes, grids, forms or indexers.
This post presents some thoughts how it might work with class definitions.
2 years ago ∙ 2 minutes read
After finishing the iteration "#17 Minimum UI", I revisited the goals and the scope of the minimum viable product, and picked the most pressing task for the next iteration - "#18 Database Schema Changes".
2 years ago ∙ 1 minute read
I implemented the last user action that is typical to a CRUD application - object deletion.
2 years ago ∙ 3 minutes read
Done:
INSERT INTO ... SELECT ...
statements2 years ago ∙ 1 minute read
Yesterday, I identified the need to have some syntax in a formula query to join a notification table.
I'm still working on new Query::joinInsertNotifications()
and Query::joinUpdateNotifications()
methods.
2 years ago ∙ 2 minutes read
I wanted to implement incremental indexing in one go.
Not so quick.
I hit some major roadblocks, and I'm working on removing them, one by one.
2022 ∙ March ∙ Osm Framework
2 years ago ∙ 1 minute read
Use deleteAll()
method on a search query to, well, delete all entries from a search index.
2 years ago ∙ 2 minutes read
Yesterday, indexers started listening to query inserted
, updated
and deleted
notifications and creating records in notification tables.
Now, saving a product complains:
Table 'admin2.zi9__products__inserts' doesn't exist
Fair enough. Let's create it.
2022 ∙ March ∙ Osm Framework
2 years ago ∙ 3 minutes read
While testing notification logic in Osm Admin, an exception is thrown in $db->committing()
callback, and the logic in $db->rollback()
fails.
Let's review how transaction callbacks work, and fix it.
2 years ago ∙ 4 minutes read
Yesterday results:
POST /create
route handles the input of new object form.2 years ago ∙ 3 minutes read
I've got a little more organized, then fixed an error in selecting all products, and implemented filtered URL generation in the browser.
2 years ago ∙ 1 minute read
A list of references to the most useful blog posts about Osm Admin and Osm Framework. One day, they'll be a part of the official documentation.
2 years ago ∙ 1 minute read
Progress messages stopped working, and I fixed that. Then, I implemented a safety measure that prevent accidental deletion (or other operations) on all objects.
2 years ago ∙ 3 minutes read
In Osm Admin, I've finished implementing editing behavior of input and select controls.
For other control types, a step-by-step guide is prepared.
2 years ago ∙ 3 minutes read
In Osm Admin, object editing form is used not only for a single object editing, but also for editing multiple objects, and for creating a new object.
I also created the osmphp/extras
package as an easy way of adding Font Awesome icons to a project. Later, I'll add more optional reusable goodies to this package.
2 years ago ∙ 2 minutes read
On the list page, grid columns are implemented as control views. On the editing page, form fields are also implemented as control views.
The form Blade templates are completely migrated to Osm Admin v0.2
.
2 years ago ∙ 1 minute read
I redesigned control rendering on list and edit pages. From now, a control contains view prototypes for a grid column, a form field, and other.
2022 ∙ March ∙ Osm Framework
2 years ago ∙ 1 minute read
A View
is a short-living object that is created and computed during page rendering. You can also create a pre-configured a View
object prototype in advance, and then clone it for rendering.
It's important not to execute render-time properties while configuring the prototype.
Use view()
helper function to create render-time view instances, and mark render-time properties using #[RenderTime]
attribute to prevent accessing them before rendering.
2 years ago ∙ 2 minutes read
After getting the list page to work, I returned to the editing page.
Done:
2 years ago ∙ 3 minutes read
Yesterday, I polished the product color
facet, and, starting now, you can create a facet with a list of string options very quickly, just by marking a property as #[Faceted]
.
/**
* @property string $color #[Option(Color::class), Faceted]
*/
class Product extends Record
{
2 years ago ∙ 2 minutes read
In the product editing form, I implemented the id
filter, and made the UI query work in database-only mode, too.
2 years ago ∙ 4 minutes read
Three days ago, I started rendering faceted navigation, and namely, color
facet on the product list page.
Yesterday, I continued working on it and got the first render of the faceted navigation, defined URL action syntax, and the first facet filter applied on the product list page.
2 years ago ∙ 1 minute read
Yesterday, I optimized search responses, made search hit limit explicit, and decided not to obfuscate ID in URL.
2022 ∙ March ∙ Osm Framework
2 years ago ∙ 1 minute read
The implementation of the faceted implementation in osm.software
blog has shown that sometimes you need only facet counts, or only total count of matching entries.
Until now, Osm Framework had always queried total count
, ids
and facets
. Not anymore - and the search engine only provides the information that is actually needed.
2022 ∙ March ∙ Osm Framework
2 years ago ∙ 1 minute read
The implicit ElasticSearch hit limit is confusing. And you can't get all the hits - there is 10000 maximum hit limit that you can't exceed anyway.
Be explicit about the maximum number of search hits.
2 years ago ∙ 1 minute read
In my opinion, obfuscating object ID in a URL is not worth the effort, and here is why.
2 years ago ∙ 4 minutes read
My current goal is a minimum list page, a form page and a faceted navigation for a Product
data class.
Today, I've:
2 years ago ∙ 5 minutes read
Today, I finished indexing design, described typical indexing logic, implemented full search reindexing.
2 years ago ∙ 6 minutes read
Starting today, I'll write a daily blog post about how the Osm Admin development goes.
This is the first one. It reviews where I am today, covers creation of a search index, and revisits the design of the indexing engine and how queries orchestrate the indexing.
2 years ago ∙ 2 minutes read
In Osm Admin, I've finished indexing. It means that whenever you modify an object in the database, the changes are automatically propagated to all dependent indexed properties in the database.
I've also introduced a grid/form pair as the main user interface concept that is optimized for performing operations on multiple objects. There is also a programming interface (API) that will internally work in the same way, but without visuals. I implemented a part of this interface - an object creation form.
Osm Framework and all projects built with it - including this website and Osm Admin - are upgraded to TailwindCSS 3.0.
2 years ago ∙ 2 minutes read
Today, I finished implementing an object creation form.
It works according to the specs on Interfaces and Forms. Currently, it only supports string and integer input fields; later, there will be a lot more.
Let's review how it works.
2 years ago ∙ 3 minutes read
In Osm Admin, a form is an integral part of the class user interface. It's a very specific kind of HTML form.
In this article, I'll review what's in a class form, and how it's reflected from the application code.
2 years ago ∙ 2 minutes read
Yesterday, I described a user interface pattern for managing data of a certain data class using a grid/form pair. Let's call this grid/form pair class interface in the admin
area.
In this article, I'll examine what moving parts are inside a class interface.
2 years ago ∙ 1 minute read
So far, I've been concerned about how application data is modeled, stored and handled internally.
Yet, the final objective a user interface for viewing and editing it visually.
Let's dream a bit about how it might look like.
2 years ago ∙ 5 minutes read
Yay, indexing works!
It's changed quite a bit, so let's review how it works from the very beginning.
2 years ago ∙ 3 minutes read
For the last two weeks, I figured out two core features that will allow Osm Admin to stand out from other CRUD applications:
The foundation for the mass editing feature is data queries. Data propagation will be ensured via indexing.
I've been working on the Osm Admin indexing engine, and it's still in progress. While working on it, I reworked the inner working of data queries. Finally, I've achieved a very clear separation of various Osm Admin concerns, and documented it.
In Osm Core, I added reflection over class methods.
2 years ago ∙ 1 minute read
I'm still working on indexing, and it seems to get one more refactoring. But more on that later.
Meanwhile, let's review Osm Admin modules, their responsibilities and dependencies.
3 years ago ∙ 2 minutes read
The project repository, osmphp/admin
, follows a typical Osm Framework-based project structure. However, this repository is going to be a reusable Composer package, and has important structural differences presented in this article.
3 years ago ∙ 2 minutes read
This article introduces the core project concepts: data object, data class, data query, and data schema.
3 years ago ∙ 1 minute read
I'm super-excited to announce that I'm starting a new project codenamed "The Big Red Button". It's about defining application data structures and logic in PHP code, pressing the big red button (hence the codename), and getting fully functioning Admin Panel and API.
3 years ago ∙ 1 minute read
This sprint was dedicated to writing Osm Framework documentation, and indeed, there are 8 new in-depth documentation articles, 4-5 minutes long each.
Despite documentation focus, I kept improving the website. From now on, you can assign a canonical URL to a blog post or a documentation page, and use GitHub friendly relative URLs in documentation.
But the most important thing - I started sharing progress and insights daily on Twitter.
2021 ∙ October ∙ Osm Framework
3 years ago ∙ 1 minute read
Throw the NotImplemented
exception in any code path that is not implemented yet, and configure the debugger to stop there whenever the code path is executed.
3 years ago ∙ 4 minutes read
osm.software
website. From now on, Osm Framework documentation resides in the docs/
directory of the osmphp/framework
repository, and it is displayed in a separate section of osm.software
website. New data source indexing engine allows running complex interdependent data synchronization with a single command, osm index
. New Placeholder
class simplifies dynamic Markdown content generation.
Osm Framework. Apply dynamic traits within the same file using #[UseIn]
attribute. Implement fast dynamic routing using new DynamicRoute
class. Generate URLs using new $osm_app->base_url
property.
2021 ∙ July ∙ osm.software Website
3 years ago ∙ 1 minute read
Today, osm.software reached an important milestone - 100% Lighthouse score.
2021 ∙ July ∙ osm.software Website
3 years ago ∙ 1 minute read
This article explains how to manage and assign blog categories.
3 years ago ∙ 1 minute read
Osm Framework introduced production mode and maintenance mode. osm.software website went live.
3 years ago ∙ 1 minute read
Osm Framework introduced JS controllers, and JS unit tests. osmcommerce.com website project was renamed to osm.software, it finalized the post rendering, and introduced a tool for checking broken links.